const buf = Buffer.from('Hello world!', 'utf8'); console.log(buf.toString('hex')); // 48656c6c6f20776f726c6421
const buf = Buffer.alloc(4); buf.writeInt32BE(12345); console.log(buf); //This code creates a buffer with 4 bytes of space and writes the number 12345 in big-endian byte order (i.e., most significant byte first) to it. The resulting buffer is