toBase64()
function toBase64(str: string): string;Defined in: src/lib/utils.ts:400
Encode a string to Base64. Works in all environments including FiveM client (no btoa/TextEncoder).
Parameters
| Parameter | Type | Description |
|---|---|---|
str | string | The string to encode |
Returns
string
Base64 encoded string
Example
toBase64("Hello, World!"); // "SGVsbG8sIFdvcmxkIQ=="