Skip to content

Instantly share code, notes, and snippets.

@ralphtheninja
Created August 15, 2014 21:21
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 ralphtheninja/528f22a0c8b753264686 to your computer and use it in GitHub Desktop.
Save ralphtheninja/528f22a0c8b753264686 to your computer and use it in GitHub Desktop.
reversed genesis block
var mirror = new Buffer('6FE28C0AB6F1B372C1A6A246AE63F74F931E8365E15A089C68D6190000000000', 'hex')
console.log('buffer length should be 32 bytes (or 32 * 8 = 256 bits)', mirror.length)
console.log('mirrored genesis block (bitpay does this for some odd reason):')
console.log(mirror)
var length = mirror.length
var genesis = new Buffer(length)
for (var i = 0; i < length; ++i) {
genesis.writeUInt8(mirror.readUInt8((length - 1) - i), i)
}
console.log('real genesis block:')
console.log(genesis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment