(idLabels: Record<string, string>)
| 159 | } |
| 160 | |
| 161 | function devcontainerIdForLabels(idLabels: Record<string, string>): string { |
| 162 | const stringInput = JSON.stringify(idLabels, Object.keys(idLabels).sort()); // sort properties |
| 163 | const bufferInput = Buffer.from(stringInput, 'utf-8'); |
| 164 | const hash = crypto.createHash('sha256') |
| 165 | .update(bufferInput) |
| 166 | .digest(); |
| 167 | const uniqueId = BigInt(`0x${hash.toString('hex')}`) |
| 168 | .toString(32) |
| 169 | .padStart(52, '0'); |
| 170 | return uniqueId; |
| 171 | } |
no outgoing calls
no test coverage detected