lexicographic-integer-encoding
Lexicographically ordered integers for level(up)
. Wraps lexicographic-integer
.
level
usage with const level = const lexint = 'hex' const db = db
levelup
usage with const levelup = const encode = const leveldown = const lexint = 'hex' const db =
api
lexint = require('lexicographic-integer-encoding')(encoding, [options])
encoding
(string, required):'hex'
or'buffer'
options.strict
(boolean): opt-in to type-checking input. If true, encode will throw:- A
TypeError
if input is not a number or ifNaN
- A
RangeError
if input is < 0 or >Number.MAX_SAFE_INTEGER
- A
Returns a level-codec
compliant encoding object.
see also
monotonic-lexicographic-timestamp
:unique-lexicographic-integer
withDate.now()
to get a monotonically increasing timestamp with lexicographic order.
install
With npm do:
npm install lexicographic-integer-encoding
license
MIT © Vincent Weevers