License:
BSD style: see license.txtAuthor:
Jeff DaveyStandards:
rfc3548, rfc2045Since:
0.99.7 This module is used to decode and encode base64 char[] arrays.Example:
1 2 3 4 5 6 7 | 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; |
Params:
data | An array that will be encoded |
Params:
length | Number of bytes to be encoded |
Params:
data | what is to be encoded |
buff | buffer large enough to hold encoded data |
bytesEncoded | ref that returns how much of the buffer was filled |
Params:
data | what is to be encoded |
buff | buffer large enough to hold encoded data |
Example:
1 2 3 | char[512] encodebuf; char[] myEncodedString = encode(cast(ubyte[])"Hello, how are you today?", encodebuf); Stdout(myEncodedString).newline; // SGVsbG8sIGhvdyBhcmUgeW91IHRvZGF5Pw== |
Params:
data | what is to be encoded |
Example:
1 2 | char[] myEncodedString = encode(cast(ubyte[])"Hello, how are you today?"); Stdout(myEncodedString).newline; // SGVsbG8sIGhvdyBhcmUgeW91IHRvZGF5Pw== |
Params:
data | what is to be decoded |
Example:
1 2 | char[] myDecodedString = cast(char[])decode("SGVsbG8sIGhvdyBhcmUgeW91IHRvZGF5Pw=="); Stdout(myDecodedString).newline; // Hello, how are you today? |
Params:
data | what is to be decoded |
buff | a big enough array to hold the decoded data |
Example:
1 2 3 | ubyte[512] decodebuf; char[] myDecodedString = cast(char[])decode("SGVsbG8sIGhvdyBhcmUgeW91IHRvZGF5Pw==", decodebuf); Stdout(myDecodedString).newline; // Hello, how are you today? |