(password,username=None,uid=None)
return public.md5(public.md5(password+'_bt.cn')+salt)
@name 为指定密码加盐
        @author hwliang<2020-07-08>
        @param password string(被md5加密一次的密码)
        @param username string(用户名) 可选
        @param uid int(uid) 可选
        @return string
def password_salt(password,username=None,uid=None):
    '''
        @name 为指定密码加盐
        @author hwliang<2020-07-08>
        @param password string(被md5加密一次的密码)
        @param username string(用户名) 可选
        @param uid int(uid) 可选
        @return string
    '''
    global salt
    if not salt:
        salt = public.M('users').where('id=?',(uid,)).getField('salt')
        if salt:
            salt = salt[0]
        else:
            salt = ""
    return public.md5(public.md5(password+'_bt.cn')+salt)
def password_salt ( password , username = None , uid = None ) : global salt if not salt : salt = public . M ( 'users' ) . where ( 'id=?' , ( uid , ) ) . getField ( 'salt' ) if salt : salt = salt [ 0 ] else : salt = "" return public . md5 ( public . md5 ( password + '_bt.cn' ) + salt )