Files
ontime/apps/server/src/utils/hash.ts
T
2025-01-19 19:57:10 +01:00

10 lines
319 B
TypeScript

import { createHash } from 'node:crypto';
/**
* Creates a hash of the password that is URL safe
* @link https://stackoverflow.com/questions/17639645/websafe-encoding-of-hashed-string-in-nodejs
*/
export function hashPassword(password: string) {
return createHash('sha256').update(password).digest('base64url');
}