totemic

totemic / BaseEncodingDecoding / 0.1.0

README.md

Overview

This algorithm can encode or decode base16, base32 and base64 to printable ASCII characters.

NOTE: Non-printable character encoding will not work with this algorithm due to the single input that is wrapped in the JSON input.

Usage

Input

ParameterDescription
databinary data or encoded data
methodencode or decode
base16, 32 or 64

Output

ParameterDescription
outputbinary data or baseXX string

Examples

Encoding

For encoding, the json payload would look like to encode a string into base64:

{
  "data": "my data to encode",
  "method": "encode",
  "base": 64
}

Returns:

{
  "output": "bXkgZGF0YSB0byBlbmNvZGU=\n"
}

Decoding

For decoding, the json payload would look like to decode a string from base64:

{
  "data": "bXkgZGF0YSB0byBlbmNvZGU=\n",
  "method": "decode",
  "base": 64
}

Returns:

{
  "output": "my data to encode"
}