Skip to main content

fromBase64()

function fromBase64(b64: string): string;

Defined in: src/lib/utils.ts:473

Decode a Base64 string. Works in all environments including FiveM client (no atob/TextDecoder).

Parameters

ParameterTypeDescription
b64stringThe Base64 string to decode

Returns

string

Decoded string

Throws

If the input contains invalid Base64 characters or malformed padding.

Example

fromBase64("SGVsbG8sIFdvcmxkIQ=="); // "Hello, World!"