wasm-rquickjs-cli 0.5.3

Tool for wrapping JavaScript modules as WebAssembly components using the QuickJS engine
1
2
3
4
5
6
7
8
9
10
11
12
import assert from 'assert';
import bcrypt from 'bcrypt';

export const run = () => {
  const salt = bcrypt.genSaltSync(5);
  const hash = bcrypt.hashSync(Buffer.from('sync-secret'), salt);

  assert.strictEqual(bcrypt.compareSync('sync-secret', hash), true);
  assert.strictEqual(bcrypt.getRounds(hash), 5);

  return 'PASS: sync API supports buffer input and rounds extraction';
};