Skip to content

Instantly share code, notes, and snippets.

@branan
Created July 21, 2021 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save branan/2a5563a82a258fa4aa0cf34435ffb68d to your computer and use it in GitHub Desktop.
Save branan/2a5563a82a258fa4aa0cf34435ffb68d to your computer and use it in GitHub Desktop.
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