Created
July 30, 2020 07:27
-
-
Save lukifer195/7237fd5de746ff92f76152a33d32b7b9 to your computer and use it in GitHub Desktop.
Convert string input to hash via arg
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 hashlib | |
import sys | |
import os | |
if __name__ == '__main__': | |
try: | |
arg0 = sys.argv[1] | |
hash_object = hashlib.sha1(arg0.encode()) | |
pbHash = hash_object.hexdigest() | |
sys.stdout.write(pbHash) | |
sys.exit() | |
except Exception: | |
arg0 = input('your string: ') | |
hash_object = hashlib.sha1(arg0.encode()) | |
pbHash = hash_object.hexdigest() | |
os.system('cls') | |
sys.stdout.write(pbHash) | |
input() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment