Package Exports
- @chainsafe/pubkey-index-map
- @chainsafe/pubkey-index-map/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chainsafe/pubkey-index-map) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@chainsafe/pubkey-index-map
Small napi-rs shim with an interface similar to Map<Uint8Array, number>
but only for length 48 Uint8Arrays for keys and unsigned 32 bit numbers for values.
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map"
// instantiate a new map
let map = new PubkeyIndexMap()
const pubkey: Uint8Array = ...;
const index: number = ...;
// Add a pubkey, index to the map
map.set(pubkey, index)
// Get an index from the map
map.get(pubkey) === index
// Delete a pubkey from the map
map.delete(pubkey)
// Clear the map
map.clear()
// Check the size of the map
map.size === 0
License
MIT