-
-
Save Isaac3N/66e49b6d1554e5ae63467d61c2cf0232 to your computer and use it in GitHub Desktop.
A gist demonstrating a sha256 cryptographic hash function in python
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 | |
# initializing string | |
str = "Angie pays Christina 20 dollars" | |
# encoding Angie pays Christina 20 dollars using encode() | |
# then sending to SHA256() | |
result = hashlib.sha256(str.encode()) | |
# printing the equivalent hexadecimal value. | |
print("The sha256 encoded message is : ") | |
print(result.hexdigest()) | |
# Expected Output: | |
# The sha256 encoded message is : 29fcf5b89c8adcb6e757582a4a0b3f8ad2c2550f5fde94a3f1cea1dedd0a4c4d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment