yescrypt
Version:
Node.js bindings of the Yescrypt hashing algorithm
41 lines (25 loc) • 856 B
Markdown
Yescrypt for Node.js
============================
[](https://www.npmjs.com/package/yescrypt)
* Node.js LTS
```bash
$ yarn add yescrypt
```
```bash
$ yarn
```
```js
import { yescrypt_kdf } from './index.js';
const getRandomHex = () => Buffer.from(crypto.getRandomValues(new Uint8Array(32)));
const passwd = Buffer.from("7000000001e980924e4e1109230383e66d62945ff8e749903bea4336755c00000000000051928aff1b4d72416173a8c3948159a09a73ac3bb556aa6bfbcad1a85da7f4c1d13350531e24031b939b9e2b", "hex");
// Use random value for secure KDF
const salt = getRandomHex();
console.log(yescrypt_kdf(passwd, salt).toString('hex'));
```
[](https://github.com/openwall/yescrypt)
[](http://github.com/thynson/yescrypt-napi)