(bytes: Uint8Array)
| 30 | } |
| 31 | |
| 32 | export function bytesToBase64(bytes: Uint8Array): string { |
| 33 | const chunks: string[] = []; |
| 34 | for (let offset = 0; offset < bytes.length; offset += BASE64_CHUNK_SIZE) { |
| 35 | chunks.push(String.fromCodePoint(...bytes.subarray(offset, offset + BASE64_CHUNK_SIZE))); |
| 36 | } |
| 37 | return btoa(chunks.join('')); |
| 38 | } |
| 39 | |
| 40 | export function bodyBufferToUtf8(body: Uint8Array | string | null | undefined): string { |
| 41 | if (body == null) { |
no test coverage detected