diff options
author | Iván Ávalos <avalos@disroot.org> | 2023-07-02 23:01:47 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2023-07-26 12:09:17 -0600 |
commit | e0f32dc8996f684bf9447bf88c13c35f4e59d94f (patch) | |
tree | e8f00ed7bc92b5d0f4e755b207db4b5f66318a31 /packages/taler-util/src/argon2.ts | |
parent | ef51ba983f49b32a04bb8460f24f720f7952f306 (diff) | |
download | wallet-core-e0f32dc8996f684bf9447bf88c13c35f4e59d94f.tar.xz |
taler-util: import hash-wasm only when building for Node
Diffstat (limited to 'packages/taler-util/src/argon2.ts')
-rw-r--r-- | packages/taler-util/src/argon2.ts | 18 |
1 files changed, 18 insertions, 0 deletions
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<Uint8Array> { + return await impl.HashArgon2idImpl( + password, + salt, + iterations, + memorySize, + hashLength, + ); +} + |