pub fn reverse_bytes(data: &mut [u8])
Expand description
Reverses the order of bytes in the given slice of u8
values.
data
- A mutable slice of u8
values to reverse.
let mut data = vec![0x12, 0x34, 0x56, 0x78];
cgl_rs::utils::reverse_bytes(&mut data);
assert_eq!(data, vec![0x78, 0x56, 0x34, 0x12]);