From 014d759961c3c59b7d8cf1222a3366ad0e92a69c Mon Sep 17 00:00:00 2001 From: Andrew nuark G Date: Wed, 12 Apr 2023 01:17:00 +0700 Subject: [PATCH] Moved hashing function to own module --- secutils.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 secutils.py diff --git a/secutils.py b/secutils.py new file mode 100644 index 0000000..cdaca71 --- /dev/null +++ b/secutils.py @@ -0,0 +1,6 @@ +from hashlib import sha256 + + +def hash_password(password: str): + """Hash a password for storing.""" + return sha256(password.encode("utf-8"), usedforsecurity=True).hexdigest()