MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / arrayToBase64

Function arrayToBase64

shared/src/binary.ts:7–10  ·  view source on GitHub ↗
(bytes: Uint8Array<ArrayBuffer>)

Source from the content-addressed store, hash-verified

5
6// https://web.dev/articles/base64-encoding#btoa_and_atob_with_unicode
7export function arrayToBase64(bytes: Uint8Array<ArrayBuffer>): Base64 {
8 const binString = String.fromCodePoint(...bytes)
9 return btoa(binString).replaceAll('=', '') as Base64
10}
11
12// https://web.dev/articles/base64-encoding#btoa_and_atob_with_unicode
13export function base64ToArray(base64: Base64): Uint8Array<ArrayBuffer> {

Callers 5

encryptFunction · 0.90
dbIdToBase64Function · 0.90
remotifyDomsFunction · 0.90
binary.test.tsFile · 0.90
arrayToBase64urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected