mirror of
https://github.com/azaion/ui.git
synced 2026-06-21 10:41:10 +00:00
9 lines
245 B
TypeScript
9 lines
245 B
TypeScript
export function newGuid(): string {
|
|
return 'xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx'
|
|
.replace(/[xy]/g, function (c) {
|
|
const r = Math.random() * 16 | 0,
|
|
v = c === 'x' ? r : (r & 0x3 | 0x8);
|
|
return v.toString(16);
|
|
});
|
|
}
|