PyCryptodome library
- Install
PyCryptodome
library from the command line:
pip install pycryptodome
- Generate SHA-512/256 hash:
from Crypto.Hash import SHA512
text = 'Hello'
hashObject = SHA512.new(truncate='256')
hashObject.update(text.encode('utf-8'))
digest = hashObject.hexdigest()
print(digest)
Leave a Comment
Cancel reply