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 = sha2_512)]
pub async fn sha2_512_hash(data: &JsValue) -> Result<HashResult, JsValue> {
    HasherWrapper::new(HashType::SHA512, data)
        .hash_result()
        .await
}