var buf1 = Buffer.from('abc');
var buf2 = Buffer.from('abcd');

console.log(buf1.equals(buf2));

              
false