pub fn shuffle_objects<T: Copy>(src: &[T]) -> Vec<u8> ⓘExpand description
Shuffle an array of fixed-size objects.
The result will be a shuffled byte array. Be aware that this byte array will usually not be
portable. It can only be unshuffled by the same computer architecture as the one that shuffled
it, and sometimes only by the same compiler version. If portability is desired, then first
serialize the data and then use shuffle.
§Examples
const IN: [u16; 4] = [0x01, 0x02, 0x03, 0x04];
let out = shuffle_objects(&IN);
assert_eq!(out, [0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00]);