Created
June 27, 2023 11:42
-
-
Save color-typea/b2438416f9aeac232b50a94a57d29e03 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
from hashlib import sha256 | |
def to_hash_block(value: int) -> bytes: | |
return value.to_bytes(16 * 2, "little", signed=False) | |
hasher = sha256() | |
print(to_hash_block(1).hex()) | |
print(to_hash_block(2).hex()) | |
hasher.update(to_hash_block(1)) | |
hasher.update(to_hash_block(2)) | |
print(hasher.digest().hex()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment