MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / getMachineId

Function getMachineId

Extension/src/id.ts:56–68  ·  view source on GitHub ↗

* Code below is adapted from: * - vscode\src\vs\base\node\id.ts

(macAddress?: string)

Source from the content-addressed store, hash-verified

54 */
55
56async function getMachineId(macAddress?: string): Promise<string | undefined> {
57 if (!macAddress) {
58 return undefined;
59 }
60
61 try {
62 const crypto = await import('crypto');
63 const normalized = macAddress.toUpperCase().replace(/:/g, '-');
64 return crypto.createHash('sha256').update(normalized, 'utf8').digest('hex');
65 } catch {
66 return undefined;
67 }
68}

Callers 1

logMachineIdMappingsFunction · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected