Files
Homarr/packages/common/src/security.ts
Meier Lukas 7fa5e70d5b feat: reset password cli (#903)
* feat: add password reset cli

* feat: add homarr cli to docker image
2024-08-04 21:44:51 +02:00

11 lines
329 B
TypeScript

import { randomBytes } from "crypto";
/**
* Generates a random hex token twice the size of the given size
* @param size amount of bytes to generate
* @returns a random hex token twice the length of the given size
*/
export const generateSecureRandomToken = (size: number) => {
return randomBytes(size).toString("hex");
};