🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
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
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

hash

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