Socket
Socket
Sign inDemoInstall

invert-hash

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

invert-hash

Inverts an object hash


Version published
Maintainers
1
Created
Source

invert-hash

Computes the inverse of a hash, assuming that it is bijective.

Example


var invert = require("invert-hash")

console.log(invert({
  'a': 1,
  'b': 2,
  'c': 3
}))

//Prints out:
//
//  {
//    1: 'a',
//    2: 'b',
//    3: 'c'
//  }
//

Install

npm install invert-hash

require("invert-hash")(obj)

Computes the inverse of a hash

  • obj is a hash object

Returns An object whose keys are the values of obj and whose values are the keys of object.

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 16 Apr 2013

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