Merge pull request #619 from bdashore3/dev

Add UUID support
This commit is contained in:
Cohee
2023-07-03 01:32:32 +03:00
committed by GitHub

View File

@@ -668,3 +668,11 @@ export async function waitUntilCondition(condition, timeout = 1000, interval = 1
}, interval);
});
}
export function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}