decode

decodes an ASCII hex string and returns it as ubyte[] data. Pre-allocates the size of the array.

This decoder will ignore non-hex characters. So: SGVsbG8sIGhvd yBhcmUgeW91IH RvZGF5Pw==

Is valid.

  1. ubyte[] decode(const(char[]) data)
    ubyte[]
    decode
    (
    const(char[]) data
    )
  2. ubyte[] decode(const(char[]) data, ubyte[] buff)

Parameters

data const(char[])

what is to be decoded

Examples

char[] myDecodedString = cast(char[])decode("48656C6C6F2C20686F772061726520796F7520746F6461793F");
Stdout(myDecodeString).newline; // Hello, how are you today?

Meta