Created
July 23, 2021 09:24
-
-
Save Arpan-206/0cd9db51237ff6dd1b07106d62f94dd1 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 hashlib # Importing the hashlib library. | |
# Encoding the text into bytes and storing it in the variable 'meaasage'. | |
message = "Hi! This is something to encode.".encode() | |
# The MD5 hash. | |
print("MD5:", hashlib.md5(message).hexdigest()) | |
# The SHA2 hashes. | |
print("SHA-256:", hashlib.sha256(message).hexdigest()) | |
print("SHA-512:", hashlib.sha512(message).hexdigest()) | |
# The SHA3 hashes. | |
print("SHA-3-256:", hashlib.sha3_256(message).hexdigest()) | |
print("SHA-3-512:", hashlib.sha3_512(message).hexdigest()) | |
# 256-bit Blake2 hash. | |
print("BLAKE2c:", hashlib.blake2s(message).hexdigest()) | |
# 512-bit BLAKE2 hash. | |
print("BLAKE2b:", hashlib.blake2b(message).hexdigest()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment