Skip to content

chiefbiiko/base64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

base64

Travis AppVeyor

base64 strings from/to Uint8Arrays

Import

import * as base64 from "https://denopkg.com/chiefbiiko/base64/mod.ts";

Usage

import * as base64 from "https://denopkg.com/chiefbiiko/base64/mod.ts";

const b64: string = base64.fromUint8Array(new TextEncoder().encode("this is too much"));
const buf: Uint8Array = base64.toUint8Array(b64);

If you need a URL and file name safe base64 variant import * as base64url from "https://denopkg.com/chiefbiiko/base64/base64url.ts";

API

base64.fromUint8Array(buf: Uint8Array): string

Transcode a base64 string from a byte array.

base64.toUint8Array(b64: string): Uint8Array

Turn a base64 string to a byte array.

base64.byteLength(b64: string): number

Calculate the byte length of a base64 string.

License

MIT

About

base64 strings from/to Uint8Arrays

Resources

License

Stars

Watchers

Forks

Packages

No packages published