No! Primate Mutation!

    pbkdf2-wrapper

    1.3.4 • Public • Published

    pbkdf2-wrapper

    GitHub code size in bytes GitHub package.json version GitHub

    A light wrapper around the native inbuilt pbkdf2 crypto functions used for password hashing, exposing promises and callbacks.

    Installation

    npm install --save pbkdf2-wrapper

    Example Usage

    const hashText = require('pbkdf2-wrapper/hashText')
    const verifyHash = require('pbkdf2-wrapper/verifyHash')
    
    // config is optional, if not passed will use the following as defaults
    const config = {
      encoding: 'hex',
      digest: 'sha256',
      hashBytes: 32,
      saltBytes: 16,
      iterations: 372791
    }
    
    // Promises
    const password = await hashText('test-password', config)
    const equality = await verifyHash('test-password', password, config)
    
    // Callbacks
    hashText('test-password', config, function (error, hash){})
    verifyHash('test-password', password, config, function (err, equality){})
    
    // Deferred callbacks
    const hashPassword = hashText('test-password', config)
    hashPassword(function (error, hash){})
    
    const verifyPassword = verifyHash('test-password', password)
    verifyPassword(function (err, equality){})

    License

    This project is licensed under the terms of the MIT license.

    Install

    npm i pbkdf2-wrapper

    DownloadsWeekly Downloads

    73

    Version

    1.3.4

    License

    MIT

    Unpacked Size

    5.92 kB

    Total Files

    7

    Last publish

    Collaborators

    • markwylde