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

Function base64ToArray

shared/src/binary.ts:13–16  ·  view source on GitHub ↗
(base64: Base64)

Source from the content-addressed store, hash-verified

11
12// https://web.dev/articles/base64-encoding#btoa_and_atob_with_unicode
13export function base64ToArray(base64: Base64): Uint8Array<ArrayBuffer> {
14 const binString = atob(base64)
15 return Uint8Array.from(binString, (m) => m.codePointAt(0)!)
16}
17
18export function toBase64URL(base64: Base64): Base64Url {
19 return base64.replaceAll('+', '-').replaceAll('/', '_') as Base64Url

Callers 12

getTokenKeyFunction · 0.90
setKeyMethod · 0.90
decryptFunction · 0.90
setKeyMethod · 0.90
getCsrfKeyFunction · 0.90
replaceImgSrcsFunction · 0.90
fromBase64Function · 0.90
getHubSessionSecretFunction · 0.90
getPublicMediaKeyFunction · 0.90
updateRemotesFunction · 0.90
binary.test.tsFile · 0.90
base64urlToArrayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected