13 releases
0.3.0 | Mar 3, 2025 |
---|---|
0.2.1 | Feb 26, 2025 |
0.1.171 | Feb 16, 2025 |
#134 in Compression
1,218 downloads per month
19KB
294 lines
HyperArchive: Ultra fast compressed real-time archive method
You need TOKIO to run HPA format (HPA is an Async Archive)
IF YOU'RE SWITCHING FROM VERSION 0.1.X I HIGHLY RECOMMAND YOU TO EXPORT YOUR HPA FILE, THERES NO UPDATER IN VERSION 0.2.X
Usage example::
use tokio;
use hyper_archive;
#[tokio::main]
async fn main() {
set_password("password").await; // Set password for AES-256
set_compression_algorithm(lib::Algorithms::Algorithm_You_Prefer).await; // To chose algorithm
hyper_archive::write_structure("your_file", "hpa_file", /* encrypt (True or False) */).await.unwrap(); // Creates an HPA file and writes data inside
let your_variable_name = hyper_archive::read_structure("your_fil_name_and_extension", "hpa_file", /* is encrypted (True or False) */).await.unwrap(); // Reading data block and returns data, and you don't have to use let, you can dump in file or whatever
hyper_archive::add_structure("your_file", "hpa_file", /* encrypt (True or False) */).await.unwrap(); // Adding data block to HPA file
hyper_archive::remove_structure("your_fil_name_and_extension", "hpa_file", /* is encrypted (True or False) */).await.unwrap(); // Removing data block from HPA file
hyper_archive::update_structure("your_file", "hpa_file", /* is encrypted (True or False) */).await.unwrap(); // Updates data block in HPA file
hyper_archive::export_structure("your_file", "hpa_file", "export_file_name", /* is encrypted (True or False) */).await.unwrap(); // Exports data block in HPA file
// I don't recommand you to use unwrap.
// Not: When you're calling a hpa you have to enter extension: test.txt -> test.txt
// If you want you can use with tokio::spawn / tokio::task::spawn / ... Example:
let return_data = tokio::spawn(async {
hyper_archive::read_structure("your_file_name_and_extension", "hpa_file").await.unwrap()
}).await.unwrap();
println!("{:?}", return_data); // It won't really work but still will be in Async
}
Which case you should use HPA?:
- When you use a File, and it's too big, you can use HPA at ease (File shouldn't be compressed before, if it is compressed file size may can be increased and in extreme case scenario file can be broke)
- When you need compression and speed (Still file shouldn't be compressed)
- In any case scenario (Yeah you can develop a game with HPA, but I don't recommend personally because adding every file by hand in HPA will be like and its speed won't be good as native. And of course some files may not work)
VERSION 0.3:
- Error handling
- Now you can switch between ZSTD and LZ4
- Faster respond times
- Overall improvements
-
Documents coming on version 0.3.1
-
Survey: Survey
-
This project still in Beta
-
Author: Metehan
-
Contact me: metehan@zaferoglu.me
Dependencies
~8–15MB
~183K SLoC