decode

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

This decoder will ignore non-base64 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("SGVsbG8sIGhvdyBhcmUgeW91IHRvZGF5Pw==");
Stdout(myDecodedString).newline; // Hello, how are you today?

Meta