Libraries
Encoding Source Code
 previous   up   next 

Function Summary
string
toBase64 (in string: byteStri)
Encode a string with the Base64 encoding.
string
fromBase64 (in string: base64)
Decode a Base64 encoded string.
string
toQuotedPrintable (in string: byteStri)
Encode a string with the Quoted-printable encoding.
string
fromQuotedPrintable (in string: quoted)
Decode a quoted-printable encoded string.
string
toUuencoded (in string: byteStri)
Encode a string with uuencoding.
string
fromUuencoded (in string: uuencoded)
Decode an uuencoded string.
string
toPercentEncoded (in string: byteStri)
Encode a string with percent-encoding.
string
fromPercentEncoded (in string: percentEncoded)
Decode a percent-encoded string.
string
toUrlEncoded (in string: byteStri)
Encode a string with URL encoding.
string
fromUrlEncoded (in string: urlEncoded)
Decode an URL encoded string.
string
toAscii85 (in string: byteStri)
Encode a string with the Ascii85 encoding.
string
fromAscii85 (in string: ascii85)
Decode a Ascii85 encoded string.
string
toBase (in bigInteger: number, in string: digits)
Encode a number with a positional numeric system.
bigInteger
fromBaseToBigInt (in string: encoded, in string: digits)
Decode a string that has been encoded with a positional numeric system.
string
toBase (in string: byteStri, in string: digits)
Encode a string of bytes with a positional numeric system.
string
fromBase (in string: encoded, in string: digits)
Decode a string that has been encoded with a positional numeric system.
string
toBase58 (in string: byteStri)
Encode a string with the Base58 encoding used by Bitcoin.
string
fromBase58 (in string: base58)
Decode a Base58 encoded 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 encoded 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 a 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.

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.


 previous   up   next