contents   index   previous   next



Buffer.equal ()

syntax:

Buffer.equal(buffer1,buffer2)

where:

buffer1,buffer2 - Two buffer objects to be compared.

 

return:

true if two buffers are equal, else false

 

description:

There is no insensitive compare, Buffer equali(), since buffers are not strings. To compare buffers as strings, use the toString() or valueOf() methods and make string comparisons. By using these methods, ASCII and Unicode buffers, holding string data, may be compared.

 

see:

Buffer(), Buffer equal(), Buffer.compare (), Buffer compare()

 

example:

// The following code:

var bufa = Buffer("ab");

var bufb = new Buffer("ab\0");

var cmp = Buffer.equal(bufa,bufb)

// will set the variable cmp to be false


internal_bufferobject-1