Skip to content

Instantly share code, notes, and snippets.

@HAOYUatHZ
Last active October 18, 2018 05:07
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 HAOYUatHZ/1993e9ff1578e7155e25048c3c03b536 to your computer and use it in GitHub Desktop.
Save HAOYUatHZ/1993e9ff1578e7155e25048c3c03b536 to your computer and use it in GitHub Desktop.
targetHex := job.Target
decoded, _ := hex.DecodeString(targetHex)
decoded = reverse(decoded)
target_int := new(big.Int).SetBytes(padded)
max_bits_int := 1*(2^55-1)*256^((2^8-1)-3)
share := max_bits_int / target_int

hash_rate := sum(share)/duration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment