base64-js-tools
v1.0.2
Published
Encode/Decode base64 from byte array or text
Downloads
8
Readme
base64-js-tools
Encode/Decode base64 from byte array or text
Demo
Online Base64 Encode File Or Image
Online Base64 Encode/Decode Text
With npm
Install
$ npm install --save base64-js-tools
Import
import { Base64 } from "base64-js-tools";
or
const { Base64 } = require("base64-js-tools");
In web browsers
<script src="base64.min.js"></script>
or
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/base64.min.js"></script>
Usage
Encode
Base64.encodeByteArray([208, 176, 121, 55, 56, 42, 38, 54]); // 0LB5NzgqJjY=
Base64.encodeText("dew^&5654"); // ZGV3XiY1NjU0
Decode
Base64.decodeToByteArray("0LB5NzgqJjY="); // [208, 176, 121, 55, 56, 42, 38, 54]
Base64.decodeToText("ZGV3XiY1NjU0"); // dew^&5654