Files
invitation/frontend/src/utils/hashPassword.tsx
2025-10-31 17:30:08 +02:00

11 lines
364 B
TypeScript

// 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
};