fix password hashing
# doc.python.org
This commit is contained in:
parent
b4ba12f5c8
commit
65d0aae9c9
1 changed files with 4 additions and 1 deletions
5
auth.py
5
auth.py
|
@ -31,7 +31,10 @@ def write_pwdb(pwdb, PWDB_PATH):
|
|||
|
||||
|
||||
def pwhash(pwd):
|
||||
return sha256(pwd)
|
||||
encoded_pwd = pwd.encode("utf-8")
|
||||
m = sha256()
|
||||
m.update(encoded_pwd)
|
||||
return m.hexdigest()
|
||||
|
||||
if __name__ == "__main__":
|
||||
PWDB_PATH = 'pwdb.json'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue