D Programming Language 2.0

- Comments
- D
- Search
- Home

Last update Sun Jun 13 09:38:33 2010

# 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(string str, char[] buf);
  Encodes str[] and places the result in buf[].

  Parameters:

  string str | string to encode
  char[] buf | destination buffer, must be large enough for the result.

  Returns:
  slice into buf[] representing encoded result

string encode(string 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(string estr, char[] buf);
  Decodes str[] and places the result in buf[].

  Parameters:

  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[].

string decode(string estr);
  Decodes estr[] and returns the result.

  Errors:
  Throws Base64Exception on invalid base64 encoding in estr[]. Throws Base64CharException on invalid base64 character in estr[].

Copyright © 1999-2010 by Digital Mars, All Rights Reserved | Page generated by Ddoc.