Prashoon123 / base64-encoder-decoder

Helps to encode a string to base64 and decode a base64 string to a normal string.

Home Page:https://www.npmjs.com/package/@prashoonb/base64-encoder-decoder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@prashoonb/base64-encoder-decoder

Installation

npm install @prashoonb/base64-encoder-decoder

API

base64.encode(input)

This function takes a byte string (the input parameter) and encodes it according to base64.

const base64 = require("@prashoonb/base64-encoder-decoder");

const text = "foo Β© bar πŒ† baz";
const encoded = base64.encode(bytes);
console.log(encoded);
// β†’ "Zm9vIMKpIGJhciDwnYyGIGJheg=="

base64.decode(input)

This function takes a base64-encoded string (the input parameter) and decodes it.

const encoded = "Zm9vIMKpIGJhciDwnYyGIGJheg==";
const text = base64.decode(bytes);
console.log(text);
// β†’ "foo Β© bar πŒ† baz"

Author

twitter/prashoonb
Prashoon Bhattacharjee

License

@prashoonb/base64-encoder-decoder is available under the MIT license.

Credits

Inspired by Mathias Bynens' base64 package.

About

Helps to encode a string to base64 and decode a base64 string to a normal string.

https://www.npmjs.com/package/@prashoonb/base64-encoder-decoder


Languages

Language:JavaScript 100.0%