hash-wasm-rs 0.1.0

A WebAssembly library for computing file hashes, built with Rust.
Documentation
1
2
3
4
5
6
7
8
9
use crate::hash::{hash_result::HashResult, hash_type::HashType, hasher_wrapper::HasherWrapper};
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = blake3)]
pub async fn blake3_hash(data: &JsValue) -> Result<HashResult, JsValue> {
    HasherWrapper::new(HashType::BLAKE3, data)
        .hash_result()
        .await
}