export const procedurallyGetUuidV4 = (seed: number) => { let state = seed >>> 0 || 1; const bytes: number[] = []; for (let i = 0; i < 16; i++) { state = (Math.imul(state, 1664525) + 1013904223) >>> 0; const byte = state >>> 24; bytes.push(byte); } bytes[6] = (bytes[6] & 0x0f) | 0x40; bytes[8] = (bytes[8] & 0x3f) | 0x80; const hex: string[] = bytes.map((b) => b.toString(16).padStart(2, "0")); return ( hex.slice(0, 4).join("") + "-" + hex.slice(4, 6).join("") + "-" + hex.slice(6, 8).join("") + "-" + hex.slice(8, 10).join("") + "-" + hex.slice(10, 16).join("") ); };