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

key-gen

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

key-gen

Simple key generation tool written in node.js using Hmac algorithm

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

key-gen

A lightweight node.js key generation app.

v0.0.1

Info

Note There are 3 possible env vars that can be set in order to customise to suit your needs:

  • process.env.APP_SALT
  • process.env.APP_ENCRYPTION
  • process.env.APP_ENCODING

Default values are used if these aren't set and they can be found in config/config.js.

###Note: Prior to setting the env vars I encourage you to read on [crypto] (http://nodejs.org/api/crypto.html#crypto_crypto_createhmac_algorithm_key) from the node.js documentation and especially on Hmac class which is used in generating the key here.

Installation

$ npm install key-gen

Usage

var keyGen = require('key-gen');

var options = {
  prefix: ['identifier1', 'identifier2', 'identifier3'],
  data: {
    data1: 'data1',
    data2: 'data2',
    data3: 'data3'
  }
}

var key = keyGen.generate(options);

Provided the default config values remain unchanged the above key will equal:

identifier1:identifier2:identifier3:4c0398bf4e511bef5355c32fd71bc9f1ffcde3b144cf3725dae9062cfaa1ab118d4c984855d38dea8efa00422de45e511c3da710541c7c578ee26037ff1d9a4a

Run tests

$ make test

License

Released fully under [MIT license] (http://viktort.mit-license.org)

Keywords

FAQs

Package last updated on 19 Feb 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