[core] uuid4

This commit is contained in:
devlikepro committed 2024-08-27 16:42:39 +07:00
1 parent f7fe562bba
commit 1163dee352
1 file changed
+7 -1
+7 -1
View File
@@ -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}`;
}