frontend: big upgrade
This commit is contained in:
10
frontend/src/utils/hashPassword.tsx
Normal file
10
frontend/src/utils/hashPassword.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
// src/utils/passwordHasher.ts
|
||||
import SHA256 from 'crypto-js/sha256';
|
||||
/**
|
||||
* Hashes a password using SHA-256.
|
||||
* @param {string} password - The plain text password.
|
||||
* @returns {string} - The hashed password in hex format.
|
||||
*/
|
||||
export const hashPassword = (password: string): string => {
|
||||
return SHA256(password).toString(); // Returns the hash in hex format
|
||||
};
|
||||
Reference in New Issue
Block a user