diff --git a/src/utils/ids.ts b/src/utils/ids.ts index e1634744..c5271142 100644 --- a/src/utils/ids.ts +++ b/src/utils/ids.ts @@ -1,4 +1,10 @@ +import { v4 as uuid4 } from 'uuid'; + +/** + * Generate prefix uuid (but remove -) + * @param prefix + */ export function generatePrefixedId(prefix: string) { - const id = Math.random().toString(36).substring(7); + const id = uuid4().replace(/-/g, ''); return `${prefix}_${id}`; }