Created
July 21, 2021 16:26
-
-
Save branan/2a5563a82a258fa4aa0cf34435ffb68d to your computer and use it in GitHub Desktop.
Altair block calculation
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
const asNumber = BigInt("0xd64330b4c9eb5721260619dc4235b1bc1f342ee7c3ece88b31be96be690fb1c1") | |
const divisor = BigInt(1) << BigInt(256); | |
const result = (asNumber * (BigInt(6655171) - BigInt(6626371)) / divisor) + BigInt(6626371); | |
console.log(result) |
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
from math import floor | |
block = floor((0xd64330b4c9eb5721260619dc4235b1bc1f342ee7c3ece88b31be96be690fb1c1 * (6655171-6626371)) / 2**256) + 6626371 | |
print(block) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment