The input range to encode.
The char[] buffer to store the encoded result.
The slice of buffer that contains the encoded string.
ubyte[6] data = [0x83, 0xd7, 0x30, 0x7a, 0x01, 0x3f]; char[32] buffer; // much bigger than necessary // Just to be sure... auto encodedLength = Base64.encodeLength(data.length); assert(buffer.length >= encodedLength); // encode() returns a slice to the provided buffer. auto encoded = Base64.encode(data[], buffer[]); assert(encoded is buffer[0 .. encodedLength]); assert(encoded == "g9cwegE/");
Encode source into a char[] buffer using Base64 encoding.