Add "To Base58" and "From Base58" operations

This commit is contained in:
toby 2017-02-10 13:31:59 -05:00
parent 0fd2550190
commit e26e6a4961
3 changed files with 169 additions and 0 deletions

View file

@ -164,6 +164,37 @@ var OperationConfig = {
},
]
},
"From Base58": {
description: "Base58 (similar to Base64) is a notation for encoding arbitrary byte data. It improves upon Base64 by removing easily misread characters (i.e. lI0O) to improve human readability.<br><br>This operation decodes data from an ASCII string (with an alphabet of your choosing, presets included) back into its raw form.<br><br>e.g. <code>StV1DL6CwTryKyV</code> becomes <code>hello world</code><br><br>Base58 is commonly used in cryptocurrencies (Bitcoin, Ripple, etc).",
run: Base58.runFrom,
inputType: "string",
outputType: "byteArray",
args: [
{
name: "Alphabet",
type: "editableOption",
value: Base58.ALPHABET_OPTIONS
},
{
name: "Remove non&#8209;alphabet chars",
type: "boolean",
value: Base58.REMOVE_NON_ALPH_CHARS
}
]
},
"To Base58": {
description: "Base58 (similar to Base64) is a notation for encoding arbitrary byte data. It improves upon Base64 by removing easily misread characters (i.e. lI0O) to improve human readability.<br><br>This operation encodes data in an ASCII string (with an alphabet of your choosing, presets included).<br><br>e.g. <code>hello world</code> becomes <code>StV1DL6CwTryKyV</code><br><br>Base58 is commonly used in cryptocurrencies (Bitcoin, Ripple, etc).",
run: Base58.runTo,
inputType: "byteArray",
outputType: "string",
args: [
{
name: "Alphabet",
type: "editableOption",
value: Base58.ALPHABET_OPTIONS
},
]
},
"From Base32": {
description: "Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",
run: Base64.runFrom32,