index-encoder
Encode multiple values into sorted keys
Last updated 2 years ago by mafintosh .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install index-encoder 
SYNC missed versions from official npm registry.

index-encoder

Encode multiple values into sorted keys

npm install index-encoder

Usage

const IndexEncoder = require('index-encoder')

const idx = new IndexEncoder([
  IndexEncoder.STRING,
  IndexEncoder.UINT
])

const buf = idx.encode(['foo', 42])
console.log(idx.decode(buf)) // ['foo', 42]

// pass any compact encoding name to map it to the relevant encoding
const uintType = IndexEncoder.lookup('uint')
const bufferType = IndexEncoder.lookup('buffer')
const alsoBufferType = IndexEncoder.lookup('fixed32')

License

Apache 2.0

Current Tags

  • 3.5.0                                ...           latest (9 months ago)

12 Versions

  • 3.5.0                                ...           9 months ago
  • 3.4.0                                ...           2 years ago
  • 3.3.2                                ...           2 years ago
  • 3.3.1                                ...           2 years ago
  • 3.3.0                                ...           2 years ago
  • 3.2.1                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 40
Today 0
This Week 3
This Month 30
Last Day 0
Last Week 5
Last Month 0
Dependencies (1)
Dev Dependencies (5)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE