solorice/vscodium/extensions/ritwickdey.liveserver-5.7.5/node_modules/apache-crypt
2022-04-28 21:17:01 +03:00
..
src Added vscodium 2022-04-28 21:17:01 +03:00
LICENSE Added vscodium 2022-04-28 21:17:01 +03:00
package.json Added vscodium 2022-04-28 21:17:01 +03:00
README.md Added vscodium 2022-04-28 21:17:01 +03:00

apache-crypt

Node.js package for Apache style password encryption using crypt(3).

build

Installation

Via git (or downloaded tarball):

$ git clone git://github.com/gevorg/apache-crypt.git

Via npm:

$ npm install apache-crypt

Usage

const crypt = require("apache-crypt");

// Encrypting password using auto-generated 2 char salt.
const encryptedPassword = crypt("mypass");

// Should print true.
console.log(crypt("mypass", encryptedPassword) == encryptedPassword);
// Should print false.
console.log(crypt("notmypass", encryptedPassword) == encryptedPassword);

Running tests

It uses mocha, so just run following command in package directory:

$ npm test

License

The MIT License (MIT)