Skip to main content
Module

std/encoding/base64.ts>encodeBase64

The Deno Standard Library
Go to Latest
function encodeBase64
import { encodeBase64 } from "https://deno.land/std@0.223.0/encoding/base64.ts";

Converts data into a base64-encoded string.

Examples

Example 1

import { encodeBase64 } from "https://deno.land/std@0.223.0/encoding/base64.ts";

encodeBase64("foobar"); // "Zm9vYmFy"

Parameters

data: ArrayBuffer | Uint8Array | string

The data to encode.

Returns

string

The base64-encoded string.