bitlab
Extracting a range of bits from binary data
Objective:
To help developing applications, which extract bit level data from a binary source such as spacecraft telemetry
Status
Experimental
Version
0.0.3
Examples
Example 1:
To extract 3 bits starting at bit index 5 within a byte (0xFF) and interpret them as an unsigned integer
use *;
let c = 0xFFu8;
let b = extract_u8.unwrap;
assert_eq!;
Example 2:
The data source is a vector of u8 types. We want to go to byte offset 1, bit offset 7 and starting from there extract 3 bits as an u16
use *;
let v: = vec!; // = "Hallo"
let bar = u16; // relevant bytes = 0x616C = 0b0110000 --> 101 <-- 101100
assert_eq!;