buf.equals(otherBuffer)
- otherBuffer {Buffer}
- 返回:{Boolean}
返回一个 boolean 标识,无论 this 和 otherBuffer 是否具有完全相同的字节。
```
const buf1 = Buffer.from('ABC');
const buf2 = Buffer.from('414243', 'hex');
const buf3 = Buffer.from('ABCD');
console.log(buf1.equals(buf2));
// Prints: true
console.log(buf1.equals(buf3));
// Prints: false