buffer-compare

Lexicographically compare two buffers.

npm install buffer-compare
8 downloads in the last week
89 downloads in the last month

Build Status

buffer-compare

Lexicographically compare two buffers.

  var compare = require('buffer-compare');

  // smaller
  compare(new Buffer('abcd'),new Buffer(abcde)) === -1

  // bigger
  compare(new Buffer('abcdef'),new Buffer('abc')) === 1

  // equal
  compare(new Buffer('hi'),new Buffer('hi')) === 0
npm loves you