Base64Impl.decode

Decodes source into newly-allocated buffer.

This convenience method alleviates the need to manually manage decoding buffers.

  1. ubyte[] decode(R1 source, R2 buffer)
  2. ubyte[] decode(R1 source, R2 buffer)
  3. size_t decode(R1 source, R2 range)
  4. size_t decode(R1 source, R2 range)
  5. ubyte[] decode(Range source)
    template Base64Impl(char Map62th, char Map63th, char Padding = '=')
    @safe pure
    ubyte[]
    decode
    (
    Range
    )
    (
    Range source
    )
    if (
    isArray!Range &&
    is(ElementType!Range : dchar)
    )
  6. ubyte[] decode(Range source)

Parameters

source Range

The input range to decode.

Return Value

Type: ubyte[]

A newly-allocated ubyte[] buffer containing the decoded string.

Examples

auto data = "Gis8TV1u";
assert(Base64.decode(data) == [0x1a, 0x2b, 0x3c, 0x4d, 0x5d, 0x6e]);

Meta