scrypt.ts 262 B

1234567
  1. import * as scrypt from 'scrypt-js';
  2. import { binToBase64 } from './common';
  3. export const hash = async (passphrase: Uint8Array, salt: Uint8Array) => {
  4. const result = await scrypt.scrypt(passphrase, salt, 16384, 16, 1, 32);
  5. return binToBase64(result);
  6. }