MCPcopy Create free account
hub / github.com/RustCrypto/formats / decoded_len

Function decoded_len

base64ct/src/encoding.rs:349–354  ·  view source on GitHub ↗
(input_len: usize)

Source from the content-addressed store, hash-verified

347#[allow(clippy::integer_arithmetic)]
348#[inline(always)]
349pub(crate) fn decoded_len(input_len: usize) -> usize {
350 // overflow-proof computation of `(3*n)/4`
351 let k = input_len / 4;
352 let l = input_len - 4 * k;
353 3 * k + (3 * l) / 4
354}
355
356/// Branchless match that a given byte is the `PAD` character
357// TODO(tarcieri): explicitly checked/wrapped arithmetic

Callers 3

decodeMethod · 0.70
decode_in_placeMethod · 0.70
decoded_lenMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected