decodedLenForSlice
Returns the decoded length of a base64 string, ignoring any characters in the ignore list. This operation does not run in constant time, but it aims to avoid leaking information about the underlying base64 string.
Function parameters
Parameters
- encoded:[]const u8
(best-effort) constant time hexadecimal encoding and decoding.
Types
Error sets in this namespace
Error Sets
Source
Implementation
pub fn decodedLenForSlice(decoder: DecoderWithIgnore, encoded: []const u8, variant: Variant) !usize {
var b64_len = encoded.len;
for (encoded) |c| {
if (decoder.ignored_chars.isSet(c)) b64_len -= 1;
}
return base64.decodedLen(b64_len, variant);
}