define hash function
This commit is contained in:
parent
b42ef06d91
commit
4dc47e547a
5
auth.py
5
auth.py
|
@ -28,6 +28,11 @@ def write_pwdb(pwdb, PWDB_PATH):
|
||||||
pwdb_file = open(PWDB_PATH, 'wt')
|
pwdb_file = open(PWDB_PATH, 'wt')
|
||||||
json.dump(pwdb, pwdb_file)
|
json.dump(pwdb, pwdb_file)
|
||||||
|
|
||||||
|
def hash_password(password):
|
||||||
|
hash = 0
|
||||||
|
for c in password.split():
|
||||||
|
hash += ord(c)
|
||||||
|
return hash
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
PWDB_PATH = 'pwdb.json'
|
PWDB_PATH = 'pwdb.json'
|
||||||
|
|
Loading…
Reference in a new issue