Created
February 28, 2024 14:20
-
-
Save stefanpejcic/cbe479c8d1ba4a29140a18282aa62c78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from werkzeug.security import generate_password_hash | |
def hash_password(unhashed_password): | |
hashed_password = generate_password_hash(unhashed_password) | |
return hashed_password | |
if __name__ == "__main__": | |
# Check if the correct number of command-line arguments is provided | |
if len(sys.argv) != 2: | |
print("Usage: python hash_password.py <unhashed_password>") | |
sys.exit(1) | |
# Get the unhashed password from the command-line argument | |
unhashed_password = sys.argv[1] | |
# Hash the password | |
hashed_password = hash_password(unhashed_password) | |
# Print the hashed password | |
print(hashed_password) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment