initial commit

This commit is contained in:
askiiart 2024-10-24 15:45:12 -05:00
commit 19db836ec0
Signed by untrusted user who does not match committer: askiiart
GPG key ID: EA85979611654C30
4 changed files with 48 additions and 0 deletions

24
src/main.rs Normal file
View file

@ -0,0 +1,24 @@
use std::{
fs,
io::{BufReader, Read, Write},
};
use xxhash_rust::xxh3::xxh3_128;
fn main() {
let filename = "/home/askiiart/whyy/testing/stuff-100M";
let mut stuff = fs::File::open(filename).unwrap();
let file_size: u64 = stuff.metadata().unwrap().len();
let mut buf = BufReader::new(stuff);
let mut out = fs::File::create("output").unwrap();
let mut data = [0; 16];
buf.read_exact(&mut data);
out.write(&xxh3_128(&data).to_be_bytes());
let mut location: u64 = 0;
while location <= file_size / 16 {
buf.read_exact(&mut data);
location += 1;
out.write(&xxh3_128(&data).to_be_bytes());
}
}