Skip to content

Instantly share code, notes, and snippets.

@kilpatty
Created May 15, 2019 18:47
Show Gist options
  • Save kilpatty/86646f3384454f2eccc131ddd97826b1 to your computer and use it in GitHub Desktop.
Save kilpatty/86646f3384454f2eccc131ddd97826b1 to your computer and use it in GitHub Desktop.
Handshake Serialization test
const { Block } = require("hsd");
let block = new Block();
let block2 = new Block();
block.version = 145;
block2.version = 0145;
console.log(block);
console.log(block2);
// console.log(block.toHead());
//Version snippet of the Hex is: 91 00 00 00
console.log(block.toHead().toString('hex'));
//Version snippet of the Hex is: 65 00 00 00
console.log(block2.toHead().toString('hex'));
//When using general decimal -> hex converter 145 == 91 00 00 00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment