Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chainsafe/pubkey-index-map

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainsafe/pubkey-index-map

Small napi-rs shim with an interface similar to `Map` but only for length 48 Uint8Arrays for keys and unsigned 32 bit numbers for values.

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
450
decreased by-47.18%
Maintainers
0
Weekly downloads
 
Created
Source

@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

Keywords

FAQs

Package last updated on 27 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc