ldap-ssha

0.0.2 • Public • Published

LDAP SSHA

LDAP salted password hashing library. It supports all of the "sha" variants returned by crypto.getHashes().

Install

npm install -s ldap-ssha

Usage

const ldapSsha = require('ldap-ssha');

// LdapSssha.hash(algorithm, secret, salt)
let saltedHash = ldapSsha.hash('SSHA', 'foo');

// LdapSsha.verify(secret, saltedHash)
if (!ldapSsha.verify('bar', saltedHash)) {
	throw new Error('Invalid secret!');
}

let saltedHash512 = ldapSsha.hash('SSHA512', 'foo', 'optional salt');
if (ldapSsha.verify('foo', saltedHash512)) {
	console.log('Secret is valid!');
}

/ldap-ssha/

    Package Sidebar

    Install

    npm i ldap-ssha

    Weekly Downloads

    2

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    6.65 kB

    Total Files

    6

    Last publish

    Collaborators

    • jmerrick