pub fn calcSizeForSlice(decoder: *const Base64Decoder, source: []const u8) Error!usize decoder: *const Base64Decodersource: []const u8InvalidCharacterInvalidPaddingNoSpaceLeft217
218
219
220
221
222
223
224
225 pub fn calcSizeForSlice(decoder: *const Base64Decoder, source: []const u8) Error!usize {
const source_len = source.len;
var result = try decoder.calcSizeUpperBound(source_len);
if (decoder.pad_char) |pad_char| {
if (source_len >= 1 and source[source_len - 1] == pad_char) result -= 1;
if (source_len >= 2 and source[source_len - 2] == pad_char) result -= 1;
}
return result;
}
Return the exact decoded size for a slice.
InvalidPaddingis returned if the input length is not valid.