pub fn normalized_bundle_in_place(bundle: &[i8], normalized_bundle: &mut [i8]) {
    for i in 0..NUMBER_OF_SECURITY_LEVELS {
        let mut sum = 0;
        let offset = HASH_LENGTH / TRYTE_WIDTH / NUMBER_OF_SECURITY_LEVELS;
        for j in i * offset..(i + 1) * offset {
            normalized_bundle[j] = bundle[j * TRYTE_WIDTH]
                + bundle[j * TRYTE_WIDTH + 1] * 3
                + bundle[j * TRYTE_WIDTH + 2] * 9;
            sum += normalized_bundle[j];
        }
        if sum > 0 {
            while sum > 0 {
                for trit in normalized_bundle
                    .iter_mut()
                    .skip(i * offset)
                    .take((i + 1) * offset)
                {
                    if *trit > iota_constants::MIN_TRYTE_VALUE {
                        *trit -= 1;
                        break;
                    }
                }
                sum -= 1;
            }
        } else {
            while sum < 0 {
                for trit in normalized_bundle
                    .iter_mut()
                    .skip(i * offset)
                    .take((i + 1) * offset)
                {
                    if *trit < iota_constants::MAX_TRYTE_VALUE {
                        *trit += 1;
                        break;
                    }
                }
                sum += 1;
            }
        }
    }
}
/// Normalize a bundle in place
///
/// * `bundle` - Bundle to normalize
/// * `normalized_bundle` - Destination slice to modify in place
Normalize a bundle in place
`bundle` - Bundle to normalize
`normalized_bundle` - Destination slice to modify in place
Normalize a bundle in place ` bundle ` - Bundle to normalize ` normalized_bundle ` - Destination slice to modify in place
pub fn normalized_bundle_in_place(bundle: &[i8], normalized_bundle: &mut [i8]) {
    for i in 0..NUMBER_OF_SECURITY_LEVELS {
        let mut sum = 0;
        let offset = HASH_LENGTH / TRYTE_WIDTH / NUMBER_OF_SECURITY_LEVELS;
        for j in i * offset..(i + 1) * offset {
            normalized_bundle[j] = bundle[j * TRYTE_WIDTH]
                + bundle[j * TRYTE_WIDTH + 1] * 3
                + bundle[j * TRYTE_WIDTH + 2] * 9;
            sum += normalized_bundle[j];
        }
        if sum > 0 {
            while sum > 0 {
                for trit in normalized_bundle
                    .iter_mut()
                    .skip(i * offset)
                    .take((i + 1) * offset)
                {
                    if *trit > iota_constants::MIN_TRYTE_VALUE {
                        *trit -= 1;
                        break;
                    }
                }
                sum -= 1;
            }
        } else {
            while sum < 0 {
                for trit in normalized_bundle
                    .iter_mut()
                    .skip(i * offset)
                    .take((i + 1) * offset)
                {
                    if *trit < iota_constants::MAX_TRYTE_VALUE {
                        *trit += 1;
                        break;
                    }
                }
                sum += 1;
            }
        }
    }
}
pub fn normalized_bundle_in_place ( bundle : & [ i8 ] , normalized_bundle : & mut [ i8 ] ) { for i in 0 .. NUMBER_OF_SECURITY_LEVELS { let mut sum = 0 ; let offset = HASH_LENGTH / TRYTE_WIDTH / NUMBER_OF_SECURITY_LEVELS ; for j in i * offset .. ( i + 1 ) * offset { normalized_bundle [ j ] = bundle [ j * TRYTE_WIDTH ] + bundle [ j * TRYTE_WIDTH + 1 ] * 3 + bundle [ j * TRYTE_WIDTH + 2 ] * 9 ; sum += normalized_bundle [ j ] ; } if sum > 0 { while sum > 0 { for trit in normalized_bundle . iter_mut ( ) . skip ( i * offset ) . take ( ( i + 1 ) * offset ) { if * trit > iota_constants :: MIN_TRYTE_VALUE { * trit -= 1 ; break ; } } sum -= 1 ; } } else { while sum < 0 { for trit in normalized_bundle . iter_mut ( ) . skip ( i * offset ) . take ( ( i + 1 ) * offset ) { if * trit < iota_constants :: MAX_TRYTE_VALUE { * trit += 1 ; break ; } } sum += 1 ; } } } }
Normalize a bundle in place
 `bundle` - Bundle to normalize
 `normalized_bundle` - Destination slice to modify in place
Normalize a bundle in place ` bundle ` - Bundle to normalize ` normalized_bundle ` - Destination slice to modify in place
bundle
&[i8]
normalized_bundle
&mut [i8]