Base64.decodeStep

Incrementally decode a sequence of binary data from its Base-64 stringified representation. By calling this function multiple times you can convert data in chunks to avoid having to have the full encoded data in memory.

The output buffer must be large enough to fit all the data that will be written to it. Since base64 encodes 3 bytes in 4 chars you need at least: (@len / 4) * 3 + 3 bytes (+ 3 may be needed in case of non-zero state).

struct Base64
static
size_t
decodeStep
(
string inn
,
ref ubyte[] output
,
ref int state
,
ref uint save
)

Parameters

inn string

binary input data

output ubyte[]

output buffer

state int

Saved state between steps, initialize to 0

save uint

Saved state between steps, initialize to 0

Return: The number of bytes of output that was written

Meta

Since

2.12