mirror of
https://github.com/Dangoware/confetti-box.git
synced 2025-04-19 23:32:58 -05:00
* Switch database to begin using CBOR, and begin work on chunked uploads * Chunked uploads work, no feedback to client yet * Added poorly implemented progress for chunked uploads * I think these methods are cursed * Improved performance by properly limiting the number of uploads * Properly show errors in file bars again * Improved setup for chunk downloading, added chunk size to config * Ran clippy, added chunk cleaner * Ran `cargo fmt`
10 lines
305 B
Rust
10 lines
305 B
Rust
use blake3::Hash;
|
|
use std::path::Path;
|
|
|
|
/// Get the Blake3 hash of a file, without reading it all into memory
|
|
pub async fn hash_file<P: AsRef<Path>>(input: &P) -> Result<Hash, std::io::Error> {
|
|
let mut hasher = blake3::Hasher::new();
|
|
hasher.update_mmap_rayon(input)?;
|
|
|
|
Ok(hasher.finalize())
|
|
}
|