mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-06 16:03:52 +00:00
10 lines
319 B
TypeScript
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');
|
|
}
|