calculates and returns the size needed to encode the length of the array passed.
calculates and returns the size needed to encode the length passed.
decodes an ASCCI base64 string and returns it as ubyte[] data. Pre-allocates the size of the array.
decodes an ASCCI base64 string and returns it as ubyte[] data.
encodes data and returns as an ASCII base64 string.
encodes data and returns as an ASCII base64 string.
encodes data into buff and returns the number of bytes encoded. this will not terminate and pad any "leftover" bytes, and will instead only encode up to the highest number of bytes divisible by three.
char[] blah = "Hello there, my name is Jeff."; scope encodebuf = new char[allocateEncodeSize(cast(ubyte[])blah)]; char[] encoded = encode(cast(ubyte[])blah, encodebuf); scope decodebuf = new ubyte[encoded.length]; if (cast(char[])decode(encoded, decodebuf) == "Hello there, my name is Jeff.") Stdout("yay").newline;
This module is used to decode and encode base64 char[] arrays.