D
Language
Phobos
Comparisons
object
std
std.base64
std.boxer
std.compiler
std.conv
std.cover
std.ctype
std.date
std.demangle
std.file
std.format
std.gc
std.intrinsic
std.math
std.md5
std.mmfile
std.openrj
std.outbuffer
std.path
std.process
std.random
std.recls
std.regexp
std.socket
std.socketstream
std.stdint
std.stdio
std.cstream
std.stream
std.string
std.system
std.thread
std.uri
std.utf
std.zip
std.zlib
std.c.fenv
std.c.math
std.c.process
std.c.stdarg
std.c.stddef
std.c.stdio
std.c.stdlib
std.c.string
std.c.time
std.c.wcharh
std.windows.charset
std.windows
std.linux
std.c.windows
std.c.linux
|
std.base64
Encodes/decodes MIME base64 data.
References:
Wikipedia Base64
RFC 2045
- class Base64Exception: object.Exception;
- class Base64CharException: std.base64.Base64Exception;
- uint encodeLength(uint slen);
- Returns the number of bytes needed to encode a string of length slen.
- char[] encode(char[] str, char[] buf);
- Encodes str[] and places the result in buf[].
Params:
char[] str |
string to encode |
char[] buf |
destination buffer, must be large enough for the result. |
Returns:
slice into buf[] representing encoded result
- char[] encode(char[] str);
- Encodes str[] and returns the result.
- uint decodeLength(uint elen);
- Returns the number of bytes needed to decode an encoded string of this
length.
- char[] decode(char[] estr, char[] buf);
- Decodes str[] and places the result in buf[].
Params:
str |
string to encode |
char[] buf |
destination buffer, must be large enough for the result. |
Returns:
slice into buf[] representing encoded result
Errors:
Throws Base64Exception on invalid base64 encoding in estr[].
Throws Base64CharException on invalid base64 character in estr[].
- char[] decode(char[] estr);
- Decodes estr[] and returns the result.
Errors:
Throws Base64Exception on invalid base64 encoding in estr[].
Throws Base64CharException on invalid base64 character in estr[].
|