Re-format base64 data from one implementation to another.
Variants
For the latest list, please refer to base64-variants.
base64
: Vanilla base64 - defaultbase64_64
/: Vanilla base64, with 64-char linesbase64_76
: Vanilla base64, with 76-char linesrfc4648
: RFC 4648 (base64url)rfc4648_alt
: RFC 4648 with "="rfc4648_ni
: RFC 6920 (unpadded RFC 4648)y64
: YUI "Y64"xml
: XML-compatible
Install
npm install base64-format
Usage
var base64Format = ; var options = from: "base64" to: "rfc4648" ; //=> "heLLO-_.""
Note: this module supports currying.
var rfc4648 = ; ; //=> "heLLO-_."
Options
Key: type name = default
-
string from = "base64"
Desired "from" base64 variant (see "Variants"). -
string to = "base64"
Desired "to" base64 variant (see "Variants"). -
boolean clean = true
Remove non-encoding characters (courtesy of base64-clean)?