Base32Impl.decode

Decodes source and stores the result in buffer. If no _buffer is assigned, a new buffer will be created.

  1. ubyte[] decode(in C[] source, UB[] buffer = null)
    template Base32Impl(UseHex useHex = UseHex.no, UsePad usePad = UsePad.yes)
    @trusted pure
    ubyte[]
    decode
    (
    C : dchar
    UB = ubyte
    )
    (
    in C[] source
    ,
    UB[] buffer = null
    )
    if (
    isOutputRange!(UB[], ubyte)
    )
    in { assert (!buffer.ptr || buffer.length >= decodeLength(source.length), "Insufficient buffer for decoding"); }
    out (result) { immutable expect = preciseDecodeLength(source); assert (result.length == expect, "The result length is different from the expected"); }
  2. ubyte[] decode(CR source, UB[] buffer = null)
  3. size_t decode(in C[] source, UBR range)
  4. size_t decode(CR source, UBR range)

Parameters

source
Type: C[]

A _base32 character array to decode.

buffer
Type: UB[]

An array to store the decoded result.

Return Value

Type: ubyte[]

The slice of buffer containing the result.

Throws

Exception if source is an invalid _base32 data.

Meta