(b64: string)
| 187 | // Decode a base64 string to bytes. atob is available in the Workers |
| 188 | // runtime; map each character to its byte value. |
| 189 | function decodeBase64(b64: string): Uint8Array { |
| 190 | const binary = atob(b64); |
| 191 | const bytes = new Uint8Array(binary.length); |
| 192 | for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i); |
| 193 | return bytes; |
| 194 | } |