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
