decode

decodes an ASCII base32 string and returns it as ubyte[] data.

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

Is valid.

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

Parameters

data cstring

what is to be decoded

buff ubyte[]

a big enough array to hold the decoded data

Examples

ubyte[512] decodebuf;
char[] myDecodedString = cast(char[])decode("JBSWY3DPFQQGQ33XEBQXEZJAPFXXKIDUN5SGC6J7", decodebuf);
Stdout(myDecodeString).newline; // Hello, how are you today?

Meta