Crates.io | vach |
lib.rs | vach |
version | 0.6.2 |
source | src |
created_at | 2021-09-11 17:26:23.137211 |
updated_at | 2024-07-29 08:02:02.746579 |
description | A simple archiving format, designed for storing assets in compact secure containers |
homepage | |
repository | https://github.com/zeskeertwee/vach |
max_upload_size | |
id | 449789 |
size | 83,992 |
vach
, pronounced like "puck" but with a "v", is an archiving and resource transmission format. It was built to be secure, contained and protected. It was, in fact, designed by the SCP to keep your anomalous assets compact and secure during transmission. A big benefit of vach
is the fine grained control it grants it's users, as it allows for per-entry independent configuration. vach
also has in-built support for multiple compression schemes (LZ4, Snappy and Brolti), data signing, leaf bitflags, encryption and some degree of archive customization. Check out the vach
spec at spec.txt. Any and all help will be much appreciated, especially proof reading the docs and code review.
use std::fs::File;
use vach::prelude::{Archive, Resource, Flags};
let source = File::open("sounds.vach")?;
let mut archive = Archive::new(source)?;
let resource: Resource = archive.fetch_mut("footstep.wav")?;
// By default all resources are flagged as NOT secure
assert!(!resource.authenticated);
// Use the data
use my_crate::Sound;
println!("{}", Sound::new(resource.data.as_slice())?);
// Read data directly into an `io::Write` stream
let mut buffer = Vec::new();
let (flags, content_version, is_secure) = archive.fetch_mut("ftstep", &mut buffer)?;
For more information on how to use the crate, read the documentation or pass by the repository. Maybe also check out the CLI, for a more user-friendly use of
vach