Created
November 30, 2022 21:42
-
-
Save miguelmota/c45e58c5a116539b8eaa2b07e1646cb6 to your computer and use it in GitHub Desktop.
Node.js 64-bit buffer example
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
const buf = Buffer.alloc(8) | |
const view = new DataView(buf.buffer) | |
view.setBigInt64(0, BigInt(100), false) // true when little endian | |
console.log(buf.toString('hex')) // "0000000000000064" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment