Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Base64.Encoder

import { Base64 } from "https://raw.githubusercontent.com/i-xi-dev/base64.es/4.1.13/mod.ts"; 

const { Encoder } = Base64;

Base64 encoder

@example
const encoder = new Base64.Encoder();

encoder.encode(Uint8Array.of(0x03, 0x02, 0x01, 0x00, 0xFF, 0xFE, 0xFD, 0xFC));
// → "AwIBAP/+/fw="
@example
const rfc4648urlOptions = Base64.Options.RFC4648URL;
const encoder = new Base64.Encoder(rfc4648urlOptions);

encoder.encode(Uint8Array.of(0x03, 0x02, 0x01, 0x00, 0xFF, 0xFE, 0xFD, 0xFC));
// → "AwIBAP_-_fw"
class Encoder implements [BytesEncoding.Encoder] {
constructor(options?: Options);
encode(toEncode: Uint8Array): string;
}

§Implements

§
[BytesEncoding.Encoder]
[src]

§Constructors

§
new Encoder(options?: Options)
[src]
@param options

The Base64.Options dictionary.

§Methods

§
encode(toEncode: Uint8Array): string
[src]

Encodes the specified byte sequence into a string.

@param toEncode

The byte sequence to encode.

@return

A string containing the Base64-encoded characters.