MCPcopy Create free account
hub / github.com/ConsortiumAI/Consortium / encodeBase64

Function encodeBase64

packages/consortium-cli/src/api/encryption.ts:11–16  ·  view source on GitHub ↗
(buffer: Uint8Array, variant: 'base64' | 'base64url' = 'base64')

Source from the content-addressed store, hash-verified

9 * Encode a Uint8Array to base64 string
10 */
11export function encodeBase64(buffer: Uint8Array, variant: 'base64' | 'base64url' = 'base64'): string {
12 if (variant === 'base64url') {
13 return encodeBase64Url(buffer);
14 }
15 return Buffer.from(buffer).toString('base64')
16}
17
18/**
19 * Encode a Uint8Array to base64url string (URL-safe base64)

Callers 11

writeCredentialsLegacyFunction · 0.90
writeCredentialsDataKeyFunction · 0.90
sendSessionEventMethod · 0.90
updateMetadataMethod · 0.90
updateAgentStateMethod · 0.90
authGetTokenFunction · 0.90
getOrCreateSessionMethod · 0.90
handleRequestMethod · 0.90
doAuthFunction · 0.90
waitForAuthenticationFunction · 0.90

Calls 1

encodeBase64UrlFunction · 0.70

Tested by

no test coverage detected