otherBuffer{Buffer} 要与bur对比的Buffer或 [Uint8Array]。- 返回: {boolean}
如果 buf 与 otherBuffer 具有完全相同的字节,则返回 true,否则返回 false。
相当于 [buf.compare(otherBuffer) === 0][buf.compare()]。
const buf1 = Buffer.from('ABC');const buf2 = Buffer.from('414243', 'hex');const buf3 = Buffer.from('ABCD');console.log(buf1.equals(buf2));// 打印: trueconsole.log(buf1.equals(buf3));// 打印: false
