24 lines
699 B
Rust
24 lines
699 B
Rust
use false_bottom::{FB128, FBAlgo, Encode};
|
|
use std::fs;
|
|
use std::time::Instant;
|
|
|
|
fn main() {
|
|
//let inp = fs::read("input1").unwrap();
|
|
let inp = vec![0_u8; 204800];
|
|
println!("Input size: {} Bytes", inp.len());
|
|
let mut fb = FB128::init(2, 2).unwrap();
|
|
println!("Encrypting...");
|
|
let now = Instant::now();
|
|
let _key = fb.add(&inp);
|
|
let elapsed = now.elapsed().as_secs_f32();
|
|
println!("Took {} secs", elapsed);
|
|
|
|
println!("Exporting...");
|
|
let encr = fb.to_bytes().0;
|
|
let rate = encr.len() as f32 / elapsed;
|
|
println!("Rate: {rate:.1} B/sec");
|
|
let extra = encr.len() - inp.len();
|
|
let percent = extra as f32/encr.len() as f32 * 100_f32;
|
|
println!("Extra Bytes: {extra} Bytes ({percent}%)");
|
|
}
|