[🚀] mysql
This commit is contained in:
10
pkg/crypto/client/utils/uuid.ts
Normal file
10
pkg/crypto/client/utils/uuid.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 生成UUID v4
|
||||
*/
|
||||
export function generateUUID(): string {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
||||
const r = (Math.random() * 16) | 0;
|
||||
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user