xorio

Crates.ioxorio
lib.rsxorio
version0.1.0
sourcesrc
created_at2021-02-04 22:00:20.37298
updated_at2021-02-04 22:00:20.37298
descriptionA crate for XOR-ing Read/Write streams
homepage
repositoryhttps://github.com/katharostech/xorio
max_upload_size
id350737
size18,320
Crates.io Publishers (github:katharostech:crates-io-publishers)

documentation

https://docs.rs/xorio

README

xorio

Crates.io Docs.rs Katharos License

Read/Write implementation that Xor's the bytes that come through it and wraps around another Read or Write.

Examples

Writing

let mut file = File::create("my_xored_file.bin").unwrap();
let mut writer = Xor::new(file);
writer.write_all("Hello World".as_bytes());

Reading

let mut file = File::open("my_xored_file.bin").unwrap();
let mut reader = Xor::new(file);
let mut content = String::new();
reader.read_to_string(&mut content);

Custom Xor Bytes

You can also customize the bytes that it will XOR the stream with. By default it uses a single byte 0b01010101 to calculate the XOR.

let mut file = File::create("my_xored_file.bin").unwrap();
let mut writer = Xor::new_with_xor_bytes(file, vec![1, 2, 3]);
writer.write_all("Hello World".as_bytes());

License

This crate is licensed under the Katharos License which places certain restrictions on what you are allowed to use it for. Please read and understand the terms before using this crate for your project.

Commit count: 4

cargo fmt