[core] uuid4
This commit is contained in:
1 parent
f7fe562bba
commit
1163dee352
1 file changed
+7
-1
+7
-1
@@ -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}`;
|
||||
}
|
||||
Reference in new issue
Block a user