Skip to content

Instantly share code, notes, and snippets.

@branan
Created Jul 21, 2021
Embed
What would you like to do?
Altair block calculation
const asNumber = BigInt("0xd64330b4c9eb5721260619dc4235b1bc1f342ee7c3ece88b31be96be690fb1c1")
const divisor = BigInt(1) << BigInt(256);
const result = (asNumber * (BigInt(6655171) - BigInt(6626371)) / divisor) + BigInt(6626371);
console.log(result)
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