(components: string[])
| 23 | * calculation to allow tree refactorings. |
| 24 | */ |
| 25 | export 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 | } |