From e0f32dc8996f684bf9447bf88c13c35f4e59d94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20=C3=81valos?= Date: Sun, 2 Jul 2023 23:01:47 -0600 Subject: taler-util: import hash-wasm only when building for Node --- packages/taler-util/src/argon2.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/taler-util/src/argon2.ts (limited to 'packages/taler-util/src/argon2.ts') diff --git a/packages/taler-util/src/argon2.ts b/packages/taler-util/src/argon2.ts new file mode 100644 index 000000000..a2e04e53e --- /dev/null +++ b/packages/taler-util/src/argon2.ts @@ -0,0 +1,18 @@ +import * as impl from "#argon2-impl"; + +export async function hashArgon2id( + password: Uint8Array, + salt: Uint8Array, + iterations: number, + memorySize: number, + hashLength: number, +): Promise { + return await impl.HashArgon2idImpl( + password, + salt, + iterations, + memorySize, + hashLength, + ); +} + -- cgit v1.2.3