summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/argon2-impl.wasm.ts
blob: d1a36c4fec96b1924939e9a0a339aa767b28510c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { argon2id } from "hash-wasm";

export async function HashArgon2idImpl(
  password: Uint8Array,
  salt: Uint8Array,
  iterations: number,
  memorySize: number,
  hashLength: number,
): Promise<Uint8Array> {
  return await argon2id({
    password: password,
    salt: salt,
    iterations: iterations,
    memorySize: memorySize,
    hashLength: hashLength,
    parallelism: 1,
    outputType: "binary",
  });
}