Skip to content
1 min read · 63 words

Function: decodeBase64()

ts
function decodeBase64(b64: string): Uint8Array;

Defined in: src/lib/helpers/base64.ts:57

Decode a base64 string back into a Uint8Array.

Parameters

ParameterTypeDescription
b64stringThe base64 string to decode.

Returns

Uint8Array

The decoded bytes.

Remarks

Inverse of encodeBase64. Prefers Buffer.from(b64, 'base64') when globalThis.Buffer exists; otherwise decodes through atob byte-by-byte.