Created
August 15, 2014 21:21
-
-
Save ralphtheninja/528f22a0c8b753264686 to your computer and use it in GitHub Desktop.
reversed genesis block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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