Dev Helpers
← Back

Write a 32-bit integer

Write a 32-bit integer using Node.js.

Open this example in the interactive library

Source code

import { Buffer } from "node:buffer";
console.log(
  (() => {
    const bytes = Buffer.alloc(4);
    bytes.writeUInt32BE(65537);
    return bytes.toString("hex");
  })(),
);

Sample output

00010001