MCPcopy Create free account
hub / github.com/Kong/insomnia / bytesToBase64

Function bytesToBase64

packages/insomnia/src/common/utils/utf8-bytes.ts:32–38  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

30}
31
32export 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
40export function bodyBufferToUtf8(body: Uint8Array | string | null | undefined): string {
41 if (body == null) {

Callers 4

getBasicAuthHeaderFunction · 0.90
ResponseViewerFunction · 0.90
utf8-bytes.test.tsFile · 0.90
utf8ToBase64Function · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected