Skip to content

Commit

Permalink
Add missing types
Browse files Browse the repository at this point in the history
  • Loading branch information
zigazajc007 committed Aug 31, 2024
1 parent cdc2c24 commit d54ed54
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/argon2id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,14 @@ namespace Argon2id {
* @param {number} [l=32] - The desired length of the resulting hash in bytes.
* @returns {Promise<string>} A promise that resolves to the encoded hash string.
*/
export const hashEncoded = (message: string, salt = Argon2id.randomSalt(), p = 4, m = 16, t = 3, l = 32): Promise<string> =>
export const hashEncoded = (
message: string,
salt: string = Argon2id.randomSalt(),
p: number = 4,
m: number = 16,
t: number = 3,
l: number = 32
): Promise<string> =>
new Promise((res, rej) => {
if (m <= 20) m = Math.pow(2, m);
hash(message, salt, p, m, t, l)
Expand Down

0 comments on commit d54ed54

Please sign in to comment.