hash_dev #10

Open
jonassc wants to merge 3 commits from jonassc/2024-heraklion-git:hash_dev into main
Showing only changes of commit b572fd0e7e - Show all commits

10
auth.py
View file

@ -29,10 +29,14 @@ def write_pwdb(pwdb, PWDB_PATH):
json.dump(pwdb, pwdb_file) json.dump(pwdb, pwdb_file)
def hash_password(password): def hash_password(password):
hash = 0 hash_1 = 0
for c in password.split(): for c in password.split():
hash += ord(c) hash_1 += ord(c)
return hash hash_2 = int(log(hash_1) * 100000)
hash_3 = 1
for d in list(str(hash_2)):
hash_3 *= ord(d)
return hash_3
if __name__ == "__main__": if __name__ == "__main__":
PWDB_PATH = 'pwdb.json' PWDB_PATH = 'pwdb.json'