habits.andr33v.ru/server/utils/password.ts

14 lines
621 B
TypeScript

// WARNING: This is a placeholder for demonstration purposes only.
// It is NOT secure and should be replaced with a proper password hashing
// library like bcrypt or argon2 before any real-world use.
export const hashPassword = async (password: string): Promise<string> => {
// In a real implementation, you would use a salt and a strong hashing algorithm.
return `${password}-hashed`;
};
export const verifyPassword = async (password: string, hash: string): Promise<boolean> => {
// In a real implementation, the hashing library would handle this comparison securely.
return `${password}-hashed` === hash;
};