MCPcopy Create free account
hub / github.com/aws/constructs / addressOf

Function addressOf

src/private/node-addr.ts:25–37  ·  view source on GitHub ↗
(components: string[])

Source from the content-addressed store, hash-verified

23 * calculation to allow tree refactorings.
24 */
25export function addressOf(components: string[]) {
26 const hash = crypto.createHash('sha1');
27 for (const c of components) {
28 // skip components called "Default" to enable refactorings
29 if (c === HIDDEN_ID) { continue; }
30
31 hash.update(c);
32 hash.update(ADDR_SEP);
33 }
34
35 // prefix with "c8" so to ensure it starts with non-digit.
36 return 'c8' + hash.digest('hex');
37}

Callers 1

addrMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected