added missed type conversion in hash function

This commit is contained in:
Abhinav-grd 2021-01-20 08:40:28 +05:30
parent 78f4cca807
commit bbf73f1858

View file

@ -129,10 +129,10 @@ export async function verifyHash(hash: string, input: string) {
return sodium.crypto_pwhash_str_verify(hash, await fromB64(input));
}
export async function hash(input: string | Uint8Array) {
export async function hash(input: string) {
await sodium.ready;
return sodium.crypto_pwhash_str(
input,
await fromB64(input),
sodium.crypto_pwhash_OPSLIMIT_SENSITIVE,
sodium.crypto_pwhash_MEMLIMIT_MODERATE,
);