@chainsafe/pubkey-index-map
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@chainsafe/pubkey-index-map

Small napi-rs shim with an interface similar to Map<Uint8Array, number> but only for Uint8Arrays of length 48

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

Readme

Keywords

none

Package Sidebar

Install

npm i @chainsafe/pubkey-index-map

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

14.6 kB

Total Files

9

Last publish

Collaborators

  • wemeetagain
  • mpetrunic