Sanakey
3 天以前 b5c1614fe473330ceca8b7cff0f1802e19bd5039
src/utils/uuid.ts
@@ -2,6 +2,7 @@
for (let i = 0; i <= 15; i++) {
  hexList[i] = i.toString(16);
}
export function buildUUID(): string {
  let uuid = '';
  for (let i = 1; i <= 36; i++) {
@@ -10,7 +11,7 @@
    } else if (i === 15) {
      uuid += 4;
    } else if (i === 20) {
      uuid += hexList[(Math.random() * 4) | (0 + 8)];
      uuid += hexList[(Math.random() * 4) | 8];
    } else {
      uuid += hexList[(Math.random() * 16) | 0];
    }
@@ -19,7 +20,7 @@
}
let unique = 0;
export function snowUuid(prefix: string): string {
export function buildShortUUID(prefix = ''): string {
  const time = Date.now();
  const random = Math.floor(Math.random() * 1000000000);
  unique++;