Created
February 22, 2023 13:52
-
-
Save vndee/03c36dd05a3537c35241d549d8dcced2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@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