vec_i64

Function vec_i64 

Source
pub fn vec_i64(bits: &Bits) -> Vec<i64>
Expand description

Converts a bit string to a vector of 64 bit signed integers.

If the length of the the bit string is not divisible by 64 it is sign-extended to the next length that is, then it is converted.

ยงExample

let bits = Bits::new([0x10, 0x32, 0x54, 0x76]);
let longs = bits_as::vec_i64(&bits);

assert_eq!(longs.len(), 1);
assert_eq!(longs, vec![0x0000000076543210]);

let bits = Bits::from([0x10, 0x32, 0x54, 0x76]);
let longs = bits_as::vec_i64(&bits);

assert_eq!(longs.len(), 1);
assert_eq!(longs, vec![0xFFFFFFFFF6543210u64 as i64]);