Function bitconv::to_uint64 [−][src]
pub fn to_uint64<T: BitConvEndian>(data: &[u8], start_index: usize) -> u64
Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.
The to_uint64
function converts the bytes from index start_index to
start_index + 7 to a u64
value.
Example
use bitconv::{ endian::{Big, Little}, to_uint64 }; let buffer = [255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 170, 170, 170, 170, 170]; assert_eq!(255, to_uint64::<Little>(&buffer, 2)); assert_eq!(18374686479671623680, to_uint64::<Big>(&buffer, 2));