(key)
| 121 | } |
| 122 | |
| 123 | function computeExtensionIdFromKey(key) { |
| 124 | try { |
| 125 | const raw = String(key || "").trim(); |
| 126 | if (!raw) return null; |
| 127 | const buffer = Buffer.from(raw, "base64"); |
| 128 | if (!buffer.length) return null; |
| 129 | const hash = createHash("sha256").update(buffer).digest(); |
| 130 | const bytes = hash.subarray(0, 16); |
| 131 | return Array.from(bytes) |
| 132 | .map((b) => { |
| 133 | const hi = b >> 4; |
| 134 | const lo = b & 15; |
| 135 | return String.fromCharCode(97 + hi) + String.fromCharCode(97 + lo); |
| 136 | }) |
| 137 | .join(""); |
| 138 | } catch { |
| 139 | return null; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | function getExtensionIdFromManifest() { |
| 144 | const manifest = readExtensionManifest(); |
no outgoing calls
no test coverage detected