Libraries |
|
Encoding | Source Code |
|
|
Function Summary | |||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
bigInteger |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
|
Function Detail |
toBase64
const func string: toBase64 (in string: byteStri)
-
Encode a string with the Base64 encoding. Base64 encodes a byte string as ASCII string. This is done by taking packs of 6-bits and translating them into a radix-64 representation. The radix-64 digits are encoded with letters (upper case followed by lower case), digits and the characters '+' and '/'.
- Returns:
- the Base64 encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromBase64
const func string: fromBase64 (in string: base64)
-
Decode a Base64 encoded string.
- Parameters:
- base64 - Base64 encoded string without leading or trailing whitespace characters.
- Returns:
- the decoded string.
- Raises:
- RANGE_ERROR - If base64 is not in Base64 format.
toQuotedPrintable
const func string: toQuotedPrintable (in string: byteStri)
-
Encode a string with the Quoted-printable encoding. Quoted-printable encodes a byte string as ASCII string. This is done by encoding printable ASCII characters except '=' as themself. Other byte values are encoded with '=' followed by two hexadecimal digits representing the byte's numeric value.
- Returns:
- the encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromQuotedPrintable
const func string: fromQuotedPrintable (in string: quoted)
-
Decode a quoted-printable encoded string.
- Returns:
- the decoded string.
- Raises:
- RANGE_ERROR - If quoted is not in quoted-printable format.
toUuencoded
const func string: toUuencoded (in string: byteStri)
-
Encode a string with uuencoding. Uuencode encodes a byte string as ASCII string. This is done by taking packs of 6-bits and translating them into a radix-64 representation. The radix-64 digits are encoded with consecutive ASCII characters starting from ' ' (which represents 0). Every line starts with a radix-64 digit character indicating the number of data bytes encoded on that line. Some newer uuencode tools use grave accent ('`') instead of space (' ') to encode 0. This can be emulated by using: replace(toUuencoded(source), " ", "`").
- Returns:
- the encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromUuencoded
const func string: fromUuencoded (in string: uuencoded)
-
Decode an uuencoded string. Space (' ') and grave accent ('`') both are used to encode 0.
- Returns:
- the decoded string.
- Raises:
- RANGE_ERROR - If uuencoded is not in uuencoded format.
toPercentEncoded
const func string: toPercentEncoded (in string: byteStri)
-
Encode a string with percent-encoding. Percent-encoding encodes a byte string as ASCII string. This is done by encoding all characters, which are not in the set of unreserved characters (A-Z, a-z, 0-9 - _ . ~). The encoding uses a percent sign ('%') followed by two hexadecimal digits, which represent the ordinal value of the encoded character.
- Returns:
- the encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromPercentEncoded
const func string: fromPercentEncoded (in string: percentEncoded)
-
Decode a percent-encoded string. Percent-encoding encodes a byte string as ASCII string. It uses the percent sign ('%') followed by two hexadecimal digits to encode characters that otherwise would not be allowed in an URL. Allowed URL characters are encoded as themself.
- Returns:
- the decoded string.
toUrlEncoded
const func string: toUrlEncoded (in string: byteStri)
-
Encode a string with URL encoding. URL encoding encodes a byte string as ASCII string. This is done by encoding all characters, which are not in the set of unreserved characters (A-Z, a-z, 0-9 - _ . ~). The encoding uses a percent sign ('%') followed by two hexadecimal digits, which represent the ordinal value of the encoded character. A plus sign ('+') is used to encode a space (' ').
- Returns:
- the encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromUrlEncoded
const func string: fromUrlEncoded (in string: urlEncoded)
-
Decode an URL encoded string. URL encoding encodes a byte string as ASCII string. It uses the percent sign ('%') followed by two hexadecimal digits to encode characters that otherwise would not be allowed in an URL. A plus sign ('+') is used to encode a space (' '). Allowed URL characters are encoded as themself.
- Returns:
- the decoded string.
toAscii85
const func string: toAscii85 (in string: byteStri)
-
Encode a string with the Ascii85 encoding. Ascii85 encodes a byte string as ASCII string. This is done by encoding every four bytes with five printable ASCII characters. Five radix 85 digits provide enough possible values to encode the possible values of four bytes. The radix 85 digits are encoded with the characters '!' (encodes 0) through 'u' (encodes 84). If the last block of the byte string contains fewer than 4 bytes, the block is padded with up to three null bytes before encoding. After encoding, as many bytes as were added as padding are removed from the end of the output. In files the end of an Ascii85 encoding is marked with "~>" (this end marker is not added by toAscii85).
- Returns:
- the Ascii85 encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromAscii85
const func string: fromAscii85 (in string: ascii85)
-
Decode an Ascii85 encoded string. Every block of five radix 85 characters is decoded to four bytes. Radix 85 characters are between '!' (encodes 0) and 'u' (encodes 84). The character 'z' is used to encode a block of four zero bytes. White space in the Ascii85 encoded string is ignored. The last block is padded to 5 bytes with the Ascii85 character 'u', and as many bytes as were added as padding are omitted from the end of the output.
- Returns:
- the decoded string.
- Raises:
- RANGE_ERROR - If ascii85 is not in Ascii85 format.
toAsciiHex
const func string: toAsciiHex (in string: byteStri)
-
Encode a string with the AsciiHex encoding. AsciiHex encodes a byte string as ASCII string. In AsciiHex each byte is encoded with two hexadecimal digits. White-space characters in an AsciiHex encoded string are ignored. The AsciiHex encoded string ends with the character '>'.
- Returns:
- the AsciiHex encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromAsciiHex
const func string: fromAsciiHex (in string: asciiHex)
-
Decode an AsciiHex encoded string. In AsciiHex each byte is encoded with two hexadecimal digits. White-space characters in an AsciiHex encoded string are ignored. The AsciiHex encoded string ends with the character '>'. If a '>' follows the first hexadecimal digit of an encoded byte the decoding works as if a '0' is at the place of the '>'. The decoder works also correctly if the '>' is missing.
- Returns:
- the decoded string.
- Raises:
- RANGE_ERROR - If asciiHex is not in AsciiHex format.
toBase
const func string: toBase (in bigInteger: number, in string: digits)
-
Encode a number with a positional numeric system. The encoded string starts with the most significant digit.
- Parameters:
- number - BigInteger number to be encoded.
- digits - The digits used by the positional numeric system.
- Returns:
- the encoded string.
fromBaseToBigInt
const func bigInteger: fromBaseToBigInt (in string: encoded, in string: digits)
-
Decode a string that has been encoded with a positional numeric system. The encoded string starts with the most significant digit.
- Parameters:
- encoded - String containing the encoded data.
- digits - The digits used by the positional numeric system.
- Returns:
- the decoded bigInteger Number.
- Raises:
- RANGE_ERROR - If characters are present, that are not found in digits.
toBase
const func string: toBase (in string: byteStri, in string: digits)
-
Encode a string of bytes with a positional numeric system. The encoded string starts with the most significant digit. Leading zero bytes in byteStri are converted into leading zero digits in the encoded string.
- Parameters:
- byteStri - String of bytes to be encoded.
- digits - The digits used by the positional numeric system.
- Returns:
- the encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromBase
const func string: fromBase (in string: encoded, in string: digits)
-
Decode a string that has been encoded with a positional numeric system. The encoded string starts with the most significant digit. Leading zero digits in the encoded string are converted into leading zero bytes in the decoded string.
- Parameters:
- encoded - String containing the encoded data.
- digits - The digits used by the positional numeric system.
- Returns:
- the decoded string.
- Raises:
- RANGE_ERROR - If characters are present, that are not found in digits.
toBase58
const func string: toBase58 (in string: byteStri)
-
Encode a string with the Base58 encoding used by Bitcoin. Leading zero bytes ('\0;') in byteStri are converted into leading zero digits ('1') in the encoded string.
- Parameters:
- byteStri - String of bytes to be encoded.
- Returns:
- the encoded string.
- Raises:
- RANGE_ERROR - If characters beyond '\255;' are present.
fromBase58
const func string: fromBase58 (in string: base58)
-
Decode a Base58 encoded string. Leading '1' characters in base58 are converted into leading zero bytes ('\0;') in the decoded string.
- Parameters:
- base58 - String containing Base58 encoded data.
- Returns:
- the decoded string.
- Raises:
- RANGE_ERROR - If characters are present, that are not valid in the Base58 encoding used by Bitcoin.
|
|