Spaces:
Building
Building
Create generate_password_hash.py
Browse files- generate_password_hash.py +10 -0
generate_password_hash.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import hashlib
|
2 |
+
|
3 |
+
def generate_password_hash(password):
|
4 |
+
hash_value = hashlib.sha256(password.encode()).hexdigest()
|
5 |
+
return hash_value
|
6 |
+
|
7 |
+
if __name__ == "__main__":
|
8 |
+
password = input("Enter the password to hash: ")
|
9 |
+
hash_result = generate_password_hash(password)
|
10 |
+
print(f"SHA256 Hash:\n{hash_result}")
|