buffer-compare-numeric
v1.0.1
Published
Compare (Big Endian) Buffers numerically
Downloads
2
Readme
buffer-compare-numeric
Compare (Big Endian) Buffers numerically
Install
npm install buffer-compare-numeric
Usage
Will compare (Big Endian) Buffer
s numerically, ignoring leading zeros.
var cmp = require('buffer-compare-numeric')
var a = Buffer([16])
var b = Buffer([00, 17])
[a, b].sort(Buffer.compare) // [b, a]
[a, b].sort(cmp) // [a, b]