Decodes source into the given buffer.
Decodes source into a given output range.
Decodes source into newly-allocated buffer.
Given a Base64 encoded string, calculates the length of the decoded string.
Construct a Decoder that iterates over the decoding of the given Base64 encoded data.
Construct a Decoder that iterates over the decoding of the given Base64 encoded data.
Encode source into a char[] buffer using Base64 encoding.
Encodes source into an output range using Base64 encoding.
Encodes source to newly-allocated buffer.
Calculates the length needed to store the encoded string corresponding to an input of the given length.
Construct an Encoder that iterates over the Base64 encoding of the given input range.
represents no-padding encoding
An input range that iterates over the decoded data of a range of Base64 encodings.
An input range that iterates over the bytes of data decoded from a Base64 encoded string.
An input range that iterates over the respective Base64 encodings of a range of data items.
An input range that iterates over the encoded bytes of the given source data.
import std.string : representation; // pre-defined: alias Base64 = Base64Impl!('+', '/'); ubyte[] emptyArr; assert(Base64.encode(emptyArr) == ""); assert(Base64.encode("f".representation) == "Zg=="); assert(Base64.encode("foo".representation) == "Zm9v"); alias Base64Re = Base64Impl!('!', '=', Base64.NoPadding); assert(Base64Re.encode("f".representation) == "Zg"); assert(Base64Re.encode("foo".representation) == "Zm9v");
Template for implementing Base64 encoding and decoding.
For most purposes, direct usage of this template is not necessary; instead, this module provides default implementations: Base64, implementing basic Base64 encoding, and Base64URL and Base64URLNoPadding, that implement the Base64 variant for use in URLs and filenames, with and without padding, respectively.
Customized Base64 encoding schemes can be implemented by instantiating this template with the appropriate arguments. For example:
NOTE: Encoded strings will not have any padding if the Padding parameter is set to NoPadding.