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

superhash

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superhash

HashMap that supports using one or more keys of any type.

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

SuperHash

Build Status Coverage Status Code Climate

superhash

HashMap that supports using one or more keys of any type*

Hash keys are generated using multikey-hash

Installation

$ npm install superhash

Examples

var SuperHash = require('superhash');
var hashMap = new SuperHash();
var data = 'value';

Single key:

hashMap.set(/.*/g, data);
hashMap.get("/.*/g"); // returns undefined
hashMap.get(/.*/g); // returns 'value'
hashMap.delete(/.*/g); // returns true

Multiple keys:

hashMap.set(1,{ name: 'foo' }, true, data);
hashMap.get(1,{ name: 'foo' }, "true"); // returns undefined
hashMap.get(1,{ name: 'foo' }, true); // returns 'value'
hashMap.delete(1,{ name: 'foo' }, true); // returns true

API

See API.md

FAQ

What types of keys can be used?

Any primitive or mutable object can be used as a key.

Who named this module?

@nik

LICENSE

MIT

Keywords

FAQs

Package last updated on 18 May 2015

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