pdk.util.Codec

functions to convert variables into special formats

Functions


encodeStringToBase64

Encodes a String into a newly-allocated Base64 encoded String.

Arguments:

Result:

Possible exceptions


encodeFileToBase64

Encodes a File into a newly-allocated Base64 encoded String.

Arguments:

Result:

Possible exceptions


decodeBase64ToFile

Decodes a Base64 string into a File.

Arguments:

Result:

  • output :: pdk.io.File - a file representation of a decoded base 64 string

Possible exceptions


hexStringToIntegerArray

Converts a hex string to an array of integers (each integer represents a byte).

Arguments:

Result:

Possible exceptions


integerArrayToHexString

Converts an array of integers (byte values) to a hex string.

Arguments:

Result:

Possible exceptions


asciiStringToHex

Converts an ASCII string to a hex string.

Arguments:

  • asciiString :: pdk.core.String

  • size :: pdk.core.Integer - size of output hex string: can be set to 0 - output hex string will have size that is required for hex representation (double ASCII string length), can be set greater than ASCII string length - output hex string will have trailing zeros up to specified size

Result:

Possible exceptions


hexStringToAscii

Converts a hex string to an ASCII string.

Arguments:

Result:

Possible exceptions


hexStringToByteArray

Converts a hex string to a byte array.

Arguments:

Result:

Possible exceptions


byteArrayToHexString

Converts a byte array to a hex string.

Arguments:

Result:

Possible exceptions

Last updated