Skip to content
Compare Buffers numerically
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.md
README.md
index.js
package.json
test.js

README.md

buffer-compare-numeric

Compare (Big Endian) Buffers numerically

Install

npm install buffer-compare-numeric

Usage

Will compare (Big Endian) Buffers 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]

License

ISC

You can’t perform that action at this time.