MCPcopy Index your code
hub / github.com/zenstackhq/zenstack / getMachineId

Function getMachineId

packages/cli/src/utils/machine-id-utils.ts:62–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62export function getMachineId() {
63 if (!(platform in guid)) {
64 return randomUUID();
65 }
66 try {
67 const value = execSync(guid[platform as keyof typeof guid]);
68 const id = expose(value.toString());
69 if (!id) {
70 return randomUUID();
71 }
72 return hash(id);
73 } catch {
74 return randomUUID();
75 }
76}

Callers 1

TelemetryClass · 0.90

Calls 4

execSyncFunction · 0.85
exposeFunction · 0.70
hashFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected