From 4dc47e547ab3feebdd9152fad9d4e4e3f6d65fb7 Mon Sep 17 00:00:00 2001 From: ASPP Student Date: Mon, 26 Aug 2024 14:57:38 +0300 Subject: [PATCH] define hash function --- auth.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/auth.py b/auth.py index 1559a08..040ada8 100644 --- a/auth.py +++ b/auth.py @@ -28,6 +28,11 @@ def write_pwdb(pwdb, PWDB_PATH): pwdb_file = open(PWDB_PATH, 'wt') json.dump(pwdb, pwdb_file) +def hash_password(password): + hash = 0 + for c in password.split(): + hash += ord(c) + return hash if __name__ == "__main__": PWDB_PATH = 'pwdb.json'