1.1.1 • Published 7 years ago

apasswd v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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

1.1.1

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago