Skip to content

Instantly share code, notes, and snippets.

View bb111189's full-sized avatar
💭
buidl

Jun Hao Tan bb111189

💭
buidl
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bb111189 on github.
  • I am tanjunhao (https://keybase.io/tanjunhao) on keybase.
  • I have a public key whose fingerprint is 89CF BBF5 B1A5 AB9B 447B 8F17 6E9B 4856 41C3 81B6

To claim this, I am signing this object:

@bb111189
bb111189 / zildiff.py
Created February 7, 2019 13:11 — forked from nnamon/zildiff.py
Zilliqa Difficulty Calculations
def to_boundary(diff):
b = ["1"] * 256
for i in range(diff):
b[i] = "0"
return int("".join(b), 2)
def to_hashrate(diff):
boundary = to_boundary(diff)
result = pow(2, 256) / float(boundary)
return result