apasswd

1.1.1 • Public • Published

apasswd

Build Status Code Climate Code Coverage npm Version JS Standard

Password manager

Installation

$ npm install apasswd --save

Usage

Generate a New Salt

'use strict'
 
const apasswd = require('apasswd')
const co = require('co')
 
co(function * () {
  let salt = yield apasswd.newSalt(24)
 
  console.log(salt) // -> b8c0faa8df6e43fe9fa2f4a1
}).catch((err) => console.error(err))
 

Digest Text

'use strict'
 
const apasswd = require('apasswd')
const co = require('co')
 
let password = 'm*y*p*a*s*s*w*o*r*d'
let salt = '1234asdf'
 
co(function * () {
  let hash = yield apasswd.digest(password, salt)
  /* ... */
}).catch((err) => console.error(err))
 

Advanced Usage

'use strict'
 
const co = require('co')
// Define a new apasswd context.
const apasswd = require('apasswd').create({
  algorithm: 'pdkdf2', // algorithm for digest.
  iterations: 120, // Iteration count
  length: 84, // Digest key length
  format: 'hex'
})
 
co(function () {
  let hash = yield apasswd.digest('my_password', 'my_salt')
}).catch((err) => console.error(err))
 

License

This software is released under the MIT License.

Links

/apasswd/

    Package Sidebar

    Install

    npm i apasswd

    Weekly Downloads

    80

    Version

    1.1.1

    License

    MIT

    Last publish

    Collaborators

    • okunishinishi