mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 15:25:01 -04:00
Fixes spelling - Adds Base85 operation to resolve #286
This commit is contained in:
parent
9cabb1126d
commit
30840f86e9
2 changed files with 6 additions and 6 deletions
|
@ -323,7 +323,7 @@ const OperationConfig = {
|
|||
},
|
||||
"To Base85": {
|
||||
module: "Default",
|
||||
description: "Base85 (similar to Base64) is a notation for encoding arbitrary byte data. It is usually more efficient that Base64.<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>BOu!rD]j7BEbo7</code><br><br>Base85 is commonly used in Adobe's PostScript and PDF file formats.<br><br><strong>Options</strong><br><u>Alphabet</u><ul><li>Standard - The standard alphabet, referred to as Ascii85</li><li>Z85 (ZeroMQ) - A string-safe variant of Base85, which avoids quote marks and backslash characters</li><li>IPv6 - A variant of Base85 suitable for encoding IPv6 addresses (RFC 1924)</li></ul><u>Include delimeter</u><br>Adds a '<~' and '~>' delimeter to the start and end of the data. This is standard for Adobe's implementation of Base85.",
|
||||
description: "Base85 (similar to Base64) is a notation for encoding arbitrary byte data. It is usually more efficient that Base64.<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>BOu!rD]j7BEbo7</code><br><br>Base85 is commonly used in Adobe's PostScript and PDF file formats.<br><br><strong>Options</strong><br><u>Alphabet</u><ul><li>Standard - The standard alphabet, referred to as Ascii85</li><li>Z85 (ZeroMQ) - A string-safe variant of Base85, which avoids quote marks and backslash characters</li><li>IPv6 - A variant of Base85 suitable for encoding IPv6 addresses (RFC 1924)</li></ul><u>Include delimiter</u><br>Adds a '<~' and '~>' delimiter to the start and end of the data. This is standard for Adobe's implementation of Base85.",
|
||||
inputType: "byteArray",
|
||||
outputType: "string",
|
||||
args: [
|
||||
|
@ -333,9 +333,9 @@ const OperationConfig = {
|
|||
value: Base85.ALPHABET_OPTIONS
|
||||
},
|
||||
{
|
||||
name: "Include delimeter",
|
||||
name: "Include delimiter",
|
||||
type: "boolean",
|
||||
value: Base85.INCLUDE_DELIMETER
|
||||
value: Base85.INCLUDE_DELIMITER
|
||||
},
|
||||
]
|
||||
},
|
||||
|
|
|
@ -33,7 +33,7 @@ const Base85 = {
|
|||
* @constant
|
||||
* @default
|
||||
*/
|
||||
INCLUDE_DELIMETER: false,
|
||||
INCLUDE_DELIMITER: false,
|
||||
|
||||
/**
|
||||
* To Base85 operation.
|
||||
|
@ -72,14 +72,14 @@ const Base85 = {
|
|||
if (input.length < i + 4) {
|
||||
digits.splice(input.length - (i + 4), 4);
|
||||
}
|
||||
|
||||
|
||||
result += digits.map(digit => alphabet[digit]).join("");
|
||||
} else {
|
||||
result += (encoding === "Standard") ? "z" : null;
|
||||
}
|
||||
}
|
||||
|
||||
if (args[1] || Base85.INCLUDE_DELIMETER) result = "<~" + result + "~>";
|
||||
if (args[1] || Base85.INCLUDE_DELIMITER) result = "<~" + result + "~>";
|
||||
|
||||
return result;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue