How to use the base-64.version function in base-64

To help you get started, we’ve selected a few base-64 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / base-64 / base-64-tests.ts View on Github external
import * as base64 from 'base-64';
import * as utf8 from 'utf8';

let text = 'foo © bar 𝌆 baz';
let bytes = utf8.encode(text);
let encoded = base64.encode(bytes);
// → 'Zm9vIMKpIGJhciDwnYyGIGJheg=='

encoded = 'Zm9vIMKpIGJhciDwnYyGIGJheg==';
bytes = base64.decode(encoded);
text = utf8.decode(bytes);

let version = base64.version;

base-64

A robust base64 encoder/decoder that is fully compatible with `atob()` and `btoa()`, written in JavaScript.

MIT
Latest version published 4 years ago

Package Health Score

67 / 100
Full package analysis