Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 895 Bytes

File metadata and controls

32 lines (22 loc) · 895 Bytes

sha256crypt-node

sha256crypt is a pure JavaScript utility providing hash and verify functionality without the need of external dependencies.

Installation

npm install sha256crypt

Usage

hash

var sha256crypt = require('sha256crypt');
sha256crypt.hash(password, rounds, salt);
// sha256crypt.hash('password', 80000, 'wnsT7Yr92oJoP28r') => 'cKhJImk5mfuSKV9b3mumNzlbstFUplKtQXXMo4G6Ep5';

verify

var sha256crypt = require('sha256crypt');
sha256crypt.verify(password, rounds, salt, checksum);
// sha256crypt.verify('password', 80000, 'wnsT7Yr92oJoP28r', 'cKhJImk5mfuSKV9b3mumNzlbstFUplKtQXXMo4G6Ep5') => true;

Thanks

Thanks to Emscripten: An LLVM-to-JavaScript Compiler and all its contributers who made this possible.