陈鹏铭 3283bca5a2 1 8 月之前
..
.github 3283bca5a2 1 8 月之前
example 3283bca5a2 1 8 月之前
test fe36a53a7d 首次提交 8 月之前
.eslintrc 3283bca5a2 1 8 月之前
CHANGELOG.md fe36a53a7d 首次提交 8 月之前
LICENSE fe36a53a7d 首次提交 8 月之前
README.md fe36a53a7d 首次提交 8 月之前
index.js fe36a53a7d 首次提交 8 月之前
package.json fe36a53a7d 首次提交 8 月之前

README.md

buffer-equal Version Badge

github actions coverage License Downloads

npm badge

Return whether two buffers are equal.

example

var bufferEqual = require('buffer-equal');

console.dir(bufferEqual(
    new Buffer([253,254,255]),
    new Buffer([253,254,255])
));
console.dir(bufferEqual(
    new Buffer('abc'),
    new Buffer('abcd')
));
console.dir(bufferEqual(
    new Buffer('abc'),
    'abc'
));

output:

true
false
undefined

methods

var bufferEqual = require('buffer-equal');

bufferEqual(a, b)

Return whether the two buffers a and b are equal.

If a or b is not a buffer, return undefined.

install

With npm do:

npm install buffer-equal

license

MIT