Hash Password with Random Salt
| 1 | import bcrypt from "bcryptjs@2"; |
| 2 | |
| 3 | export async function main(password: string) { |
| 4 | const salt = await bcrypt.genSalt(); |
| 5 | const hash_pass = await bcrypt.hash(password, salt); |
| 6 | |
| 7 | return hash_pass; |
| 8 | } |
| 9 |
| 1 | import bcrypt from "bcryptjs@2"; |
| 2 | |
| 3 | export async function main(password: string) { |
| 4 | const salt = await bcrypt.genSalt(); |
| 5 | const hash_pass = await bcrypt.hash(password, salt); |
| 6 | |
| 7 | return hash_pass; |
| 8 | } |
| 9 |