buffer-compare-numeric

1.0.1 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2
  • 1.0.0
    0

Package Sidebar

Install

npm i buffer-compare-numeric

Weekly Downloads

2

Version

1.0.1

License

ISC

Last publish

Collaborators

  • emilbayes
  • emilbay