Function bitconv::to_uint32 [−][src]
pub fn to_uint32<T: BitConvEndian>(data: &[u8], start_index: usize) -> u32
Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.
The to_uint32
function converts the bytes from index start_index to
start_index + 3 to a u32
value.
Example
use bitconv::{ endian::{Big, Little}, to_uint32 }; let buffer = [15, 0, 0, 0, 0, 16, 0, 255, 3, 0, 0, 202, 19]; assert_eq!(261888, to_uint32::<Little>(&buffer, 6)); assert_eq!(16712448, to_uint32::<Big>(&buffer, 6));