encode

encodes data and returns as an ASCII base64 string.

  1. char[] encode(const(ubyte[]) data, char[] buff)
    char[]
    encode
    (
    const(ubyte[]) data
    ,
    char[] buff
    )
  2. char[] encode(const(ubyte[]) data)

Parameters

data const(ubyte[])

what is to be encoded

buff char[]

buffer large enough to hold encoded data

Examples

char[512] encodebuf;
char[] myEncodedString = encode(cast(ubyte[])"Hello, how are you today?", encodebuf);
Stdout(myEncodedString).newline; // SGVsbG8sIGhvdyBhcmUgeW91IHRvZGF5Pw==

Meta