Files
UT-Registration-Plus/src/shared/util/random.ts
doprz e987fbbe8e feat: add eslint-plugin-tsdoc (#430)
* feat: add eslint-plugin-tsdoc

* feat(doc): update current jsdoc to tsdoc specification

* chore: update deps

* feat: update warn to error for jsdoc and tsdoc

* chore(doc): lint
2024-11-16 00:20:36 -06:00

10 lines
300 B
TypeScript

import { customAlphabet } from 'nanoid';
/**
* Generate secure URL-friendly unique ID.
*
* @param size - Size of the ID. The default size is 12.
* @returns A random string.
*/
export const generateRandomId = customAlphabet('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 12);