1
Hash Password with Manual Salt
One script reply has been approved by the moderators Verified

Hash a password with a manually generated salt.

Created by rossmccrann 854 days ago Viewed 9209 times
0
Submitted by rossmccrann Deno
Verified 854 days ago
1
import * as bcrypt from "https://deno.land/x/bcrypt@v0.2.4/mod.ts";
2

3
export async function main(password: string, salt_num: number) {
4
  const salt = await bcrypt.genSalt(salt_num);
5
  const hash_pass = await bcrypt.hash(password, salt);
6

7
  return hash_pass;
8
}
9