/
spider0
/
Spider0
Обзор
Документация
Войти
/
spider0
/
Spider0
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/lib/projectIdentity.js
21 строка
574 B
AlexSpider0686
Add AI technical solution survey flow
28 мар 2026, 01:03
28 мар 2026, 01:03
380edeb
Код
Авторство
О чём код?
function fallbackUuid() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (char) => { const random = Math.floor(Math.random() * 16); const value = char === "x" ? random : (random & 0x3) | 0x8; return value.toString(16); }); } export function createStableUuid() { if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") { return crypto.randomUUID(); } return fallbackUuid(); } export function createProjectIdentity() { return { projectUuid: createStableUuid(), objectUuid: createStableUuid(), }; }