コード例 #1
0
ファイル: auth.py プロジェクト: pawelniewie/5groszy.pl
def encrypt_password(password, secret):
    h = hashlib.sha256()
    h.update(password)
    h.update(secret)
    return h.hexdigest()
コード例 #2
0
ファイル: auth.py プロジェクト: pawelniewie/5groszy.pl
def encrypt_password(password, secret):
    h = hashlib.sha256()
    h.update(isinstance(password, unicode) and password.encode('utf-8') or password)
    h.update(isinstance(secret, unicode) and secret.encode('utf-8') or secret)
    return h.hexdigest()
コード例 #3
0
ファイル: auth.py プロジェクト: pawelniewie/5groszy.pl
def encrypt_password(password, secret):
    h = hashlib.sha256()
    h.update(password.encode("utf-8"))
    h.update(secret.encode("utf-8"))
    return h.hexdigest()