10 releases
new 0.1.171 | Feb 16, 2025 |
---|---|
0.1.170 | Feb 16, 2025 |
#195 in Compression
664 downloads per month
11KB
123 lines
HyperArchive: Ultra fast compressed real-time archive method
You need TOKIO to run HPA format (HPA is an Async Archive)
How to use:
use tokio;
use hyper_archive;
#[tokio::main]
async fn main() {
hyper_archive::write_structure("your_file", "hpa_file").await; // Creates an HPA file and writes data inside
let your_variable_name = hyper_archive::read_structure("your_fil_name_and_extension", "hpa_file").await; // 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").await; // Adding data block to HPA file
hyper_archive::remove_structure("your_fil_name_and_extension", "hpa_file").await; // Removing data block from HPA file
hyper_archive::update_structure("your_file", "hpa_file").await; // Updates data block in HPA file
hyper_archive::export_structure("your_file", "hpa_file", "export_file_name").await; // Exports data block in HPA file
// Not: When you're calling a hpa file you don't need to type extension as well: "test" -> test.hpa
// 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
}).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 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)
-
Survey: Survey
-
This project still in Beta
-
Author: Metehan
-
Contact me: metehan@zaferoglu.me
Dependencies
~2.7–8.5MB
~65K SLoC