mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-14 02:27:07 +01:00
11 lines
329 B
TypeScript
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");
|
|
};
|