Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/oak/deps.ts>base64

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Extremely Popular
Go to Latest
namespace base64
import { base64 } from "https://deno.land/x/oak@v12.1.0/deps.ts";

encode and decode for base64 encoding.

This module is browser compatible.

Examples

Example 1

import {
  decode,
  encode,
} from "https://deno.land/std@0.224.0/encoding/base64.ts";

const b64Repr = "Zm9vYg==";

const binaryData = decode(b64Repr);
console.log(binaryData);
// => Uint8Array [ 102, 111, 111, 98 ]

console.log(encode(binaryData));
// => Zm9vYg==

Functions

Decodes a given RFC4648 base64 encoded string

CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation