diff options
author | gennyble <gen@nyble.dev> | 2023-06-09 01:38:51 -0500 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2023-06-09 01:38:51 -0500 |
commit | b08ac436beed955053b672d65715811535a46096 (patch) | |
tree | 3b7adedf8a0930b875ad9ea3f1c07c1c10b10389 /unpacker/src/main.rs | |
parent | 1e2224b6273e2b57ebf7dc90e2439c1d6075ef39 (diff) | |
download | lri-rs-b08ac436beed955053b672d65715811535a46096.tar.gz lri-rs-b08ac436beed955053b672d65715811535a46096.zip |
unpacker
Diffstat (limited to 'unpacker/src/main.rs')
-rw-r--r-- | unpacker/src/main.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/unpacker/src/main.rs b/unpacker/src/main.rs new file mode 100644 index 0000000..047b4c5 --- /dev/null +++ b/unpacker/src/main.rs @@ -0,0 +1,24 @@ +use unpacker::Unpacker; + +fn main() { + // Four bits padding at the end. + let testdata = vec![ + 0b10000000, 0b00010000, 0b00000010, 0b00000000, 0b01000000, 0b00001000, 0b00000001, + 0b00000000, 0b00100000, 0b00000100, 0b00000000, 0b10000000, 0b00010000, + ]; + + let mut up = Unpacker { + out: vec![], + work: 0, + work_idx: 0, + }; + + for byte in testdata { + up.push(byte); + } + up.finish(); + + for chnk in up.out.chunks(2) { + println!("{:08b} {:08b}", chnk[0], chnk[1]); + } +} |