3.3.2 • Published 4 months ago

index-encoder v3.3.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

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

3.3.2

4 months ago

3.3.1

6 months ago

3.3.0

6 months ago

3.2.1

7 months ago

3.2.0

8 months ago

3.1.0

8 months ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago