@copilotkit/shared
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
24 lines (23 loc) • 585 B
JavaScript
// src/utils/random-id.ts
import { v4 as uuidv4, validate, v5 as uuidv5 } from "uuid";
function randomId() {
return "ck-" + uuidv4();
}
function randomUUID() {
return uuidv4();
}
function dataToUUID(input, namespace) {
const BASE_NAMESPACE = "e4b01160-ff74-4c6e-9b27-d53cd930fe8e";
const boundNamespace = namespace ? uuidv5(namespace, BASE_NAMESPACE) : BASE_NAMESPACE;
return uuidv5(input, boundNamespace);
}
function isValidUUID(uuid) {
return validate(uuid);
}
export {
randomId,
randomUUID,
dataToUUID,
isValidUUID
};
//# sourceMappingURL=chunk-VNNKZIFB.mjs.map