decodeBase64

private fnimmutable(ubyte)[] decodeBase64(const(char)[] base64) @safe

Decode a base64 string to immutable ubyte[]. Decode a base64 string to immutable ubyte[].

Input_Validation: This function delegates to std.base64.Base64.decode which will throw Base64Exception if the input contains invalid base64 characters or has incorrect padding. The SDL parser wraps base64 data in `[...]` brackets which are stripped before calling this function.

Parameters

base64The base64-encoded string (without SDL brackets)

Returns

The decoded binary data as an immutable ubyte array

Throws

Base64Exception if the input is not valid base64