Node.js `Buffer.compare()` ponyfill
$ cnpm install buf-compare
Just use Buffer.compare(). It has been available since Node.js 0.12.
Node.js
Buffer.compare()ponyfill
$ npm install --save buf-compare
var bufCompare = require('buf-compare');
bufCompare(new Buffer('a'), new Buffer('a'));
//=> 0
bufCompare(new Buffer('a'), new Buffer('b'));
//=> -1
See the Buffer.compare() docs.
buffer.equals() ponyfillbuffer.indexOf() ponyfillMIT © Sindre Sorhus
Copyright 2013 - present © cnpmjs.org | Home |