fn normalize(data: u32, size: u8, odd: bool)-> u32{
        let shift = 32 - size;
        let remainder = size % 8;
        if odd {
            data >> shift
        } else {
            data >> shift - remainder
        }

    }
/// Justify to right the first "size" bits.
///
/// Be aware that even chunks may have some zeroed bits at the very beginning, so we should
/// shift less positions to justify to right.
///
/// # Parameters:
/// * data: Data chunk stored in an u32.
/// * size: Actual size in bits of data chunk.
/// * odd: True if this datachunk was read at an odd position.
///
/// # Returns:
/// * u32: Data chunk stored in an u32 were bits were justified at right.
Justify to right the first "size" bits.
Be aware that even chunks may have some zeroed bits at the very beginning, so we should
shift less positions to justify to right.
Justify to right the first " size " bits . Be aware that even chunks may have some zeroed bits at the very beginning so we should shift less positions to justify to right .
fn normalize(data: u32, size: u8, odd: bool)-> u32{
        let shift = 32 - size;
        let remainder = size % 8;
        if odd {
            data >> shift
        } else {
            data >> shift - remainder
        }
    }
fn normalize ( data : u32 , size : u8 , odd : bool ) -> u32 { let shift = 32 - size ; let remainder = size % 8 ; if odd { data >> shift } else { data >> shift - remainder } }
Justify to right the first "size" bits.
Justify to right the first " size " bits .
data
u32
size
u8
odd
bool
data
u32
size
u8
odd
bool
parameters:
Data chunk stored in an u32.
size: Actual size in bits of data chunk.
odd: True if this datachunk was read at an odd position.
Data chunk stored in an u32 . size : Actual size in bits of data chunk . odd : True if this datachunk was read at an odd position .
returns:
Data chunk stored in an u32 were bits were justified at right.
Data chunk stored in an u32 were bits were justified at right .