Skip to content

Instantly share code, notes, and snippets.

@ross-humphrey
Last active September 2, 2019 15:45
Show Gist options
  • Save ross-humphrey/c1d7282f3b8f992ebe38bbd516aace0f to your computer and use it in GitHub Desktop.
Save ross-humphrey/c1d7282f3b8f992ebe38bbd516aace0f to your computer and use it in GitHub Desktop.
🥢 Hasing using SHA-3 in Python
import hashlib
def sha_3_hex_digest(input_string):
"""
Given an input string a sha3 - 384 bit hex digest result
:param input_string: string to hash
:return: hexdigest string representation of input_string
"""
encoded_input = input_string.encode("utf-8")
return hashlib.sha3_384(encoded_input).hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment