const buf = Buffer.from("mlh1421"); console.log(buf.toString());
buffer与对象,数组的互转,字符串作为中间变量
const buf = Buffer.from(JSON.stringify([1, 2, 3, 4])); console.log(buf.length); console.log(buf.toString());