MCPcopy
hub / github.com/iterative/cml / deterministic

Function deterministic

src/analytics.js:39–52  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

37const ID_DO_NOT_TRACK = 'do-not-track';
38
39const deterministic = async (data) => {
40 if (!data)
41 throw new Error("data is not set, can't calculate a deterministic uuid");
42
43 const namespace = uuidv5('iterative.ai', uuidv5.DNS);
44 const name = await promisify(scrypt)(data, parse(namespace), 8, {
45 N: 1 << 16,
46 r: 8,
47 p: 1,
48 maxmem: 128 * 1024 ** 2
49 });
50
51 return uuidv5(name.toString('hex'), namespace);
52};
53
54const guessCI = () => {
55 if (GITHUB_SERVER_URL && !CODESPACES) return 'github';

Callers 2

groupIdFunction · 0.85
userIdFunction · 0.85

Calls 2

parseFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected