Hash Password with Manual Salt

Hash a password with a manually generated salt.

Script helper Verified

by rossmccrann ยท 8/4/2022

The script

Submitted by hugo989 Bun
Verified 4 days ago
1
import bcrypt from "bcryptjs@2";
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

Other submissions
  • Submitted by rossmccrann Deno
    Created 396 days ago
    1
    import * as bcrypt from "https://deno.land/x/[email protected]/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