const fn base64_decoded_length(source_length: usize) -> usize {
    // return f64::ceil(source_length / 4 * 3)
    // Can't use floating points and f64::ceil() in constant functions
    // due to https://github.com/rust-lang/rust/issues/57241
    // Workaround:
    let v = source_length * 3;
    if v % 4 > 0 {
        v / 4 + 1
    } else {
        v / 4
    }
}
/// Calculates length of a base64 decoded bytes slice
/// created from a source with the specified length.
/// This is a const function evaluated once only during compilation.
Calculates length of a base64 decoded bytes slice
created from a source with the specified length.
This is a const function evaluated once only during compilation.
Calculates length of a base64 decoded bytes slice created from a source with the specified length . This is a const function evaluated once only during compilation .
const fn base64_decoded_length(source_length: usize) -> usize {
    // return f64::ceil(source_length / 4 * 3)
    // Can't use floating points and f64::ceil() in constant functions
    // due to https://github.com/rust-lang/rust/issues/57241
    // Workaround:
    let v = source_length * 3;
    if v % 4 > 0 {
        v / 4 + 1
    } else {
        v / 4
    }
}
const fn base64_decoded_length ( source_length : usize ) -> usize { // return f64::ceil(source_length / 4 * 3) // Can't use floating points and f64::ceil() in constant functions // due to https://github.com/rust-lang/rust/issues/57241 // Workaround: let v = source_length * 3 ; if v % 4 > 0 { v / 4 + 1 } else { v / 4 } }
Calculates length of a base64 decoded bytes slice
created from a source with the specified length.
Calculates length of a base64 decoded bytes slice created from a source with the specified length .
source_length
usize
source_length
usize