narinder1231 commited on
Commit
ad62c47
·
1 Parent(s): 535594d

add util function to hash a password

Browse files
Files changed (1) hide show
  1. src/utils/passwordUtils.ts +7 -0
src/utils/passwordUtils.ts ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import bcrypt from 'bcryptjs';
2
+
3
+ export const hashPassword = async (password: string) => {
4
+ const salt = await bcrypt.genSalt(10);
5
+ const hashedPassword = await bcrypt.hash(password, salt);
6
+ return hashedPassword;
7
+ }