Skip to content

Instantly share code, notes, and snippets.

@vndee
Created February 22, 2023 13:52
Show Gist options
  • Save vndee/03c36dd05a3537c35241d549d8dcced2 to your computer and use it in GitHub Desktop.
Save vndee/03c36dd05a3537c35241d549d8dcced2 to your computer and use it in GitHub Desktop.
@staticmethod
def hash(block):
"""
Creates a SHA-256 hash of a Block
:param block: block data
:return:
"""
block_string = json.dumps(block, sort_keys=True).encode()
return hashlib.sha256(block_string).hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment