Version | Mac/Linux | Windows |
---|---|---|
This module provides native bindings to Colin Percival's scrypt.
In browser Pure JS implementation (based on scryptsy) will be used.
Current scrypt version: 1.2.1
This library is experimental, so use at your own risk.
npm install scrypt
Before install scrypt you should install windows-build-tools.
Only one function — scrypt.
scrypt(Buffer password, Buffer salt, Number N, Number r, Number p, Number length)
password
- key which will be hashedsalt
- saltN
- number of iterationsr
- memory factorp
- parallelization factorlength
- output buffer length
const scrypt = require('scrypt')
console.log(scrypt(Buffer.from('password'), Buffer.from('salt'), 262144, 1, 8, 32))
// <Buffer ec c9 3f 60 b9 75 00 ef d2 3a b7 f5 a7 96 7d 6d 89 2b 5d d3 07 69 49 15 bd 69 03 28 e7 11 08 de>
This library is free and open-source software released under the MIT license.