| Crates.io | hash-wasm-rs |
| lib.rs | hash-wasm-rs |
| version | 0.1.0 |
| created_at | 2025-09-20 06:33:24.527341+00 |
| updated_at | 2025-09-20 06:33:24.527341+00 |
| description | A WebAssembly library for computing file hashes, built with Rust. |
| homepage | https://github.com/fantasize-zero |
| repository | https://github.com/fantasize-zero/hash-wasm-rs |
| max_upload_size | |
| id | 1847469 |
| size | 33,611 |
A WebAssembly library for computing hashes, built with Rust.
| Name |
|---|
| BLAKE3 |
| MD5 |
| SHA: SHA-224, SHA-256, SHA-384, SHA-512 |
| SHA-3: SHA3-224, SHA3-256, SHA3-384, SHA3-512 |
pnpm add hash-wasm-rs
cargo install hash-wasm-rs
Example large file hash calculation
pnpm add vite-plugin-wasm
import { defineConfig } from "vite";
import wasm from "vite-plugin-wasm";
export default defineConfig(({ mode }) => ({
plugins: [wasm()],
}));
onMounted(async () => {
try {
const $hashWasmRs = await import("hash-wasm-rs");
const result = await $hashWasmRs.md5("Hello, world!");
console.log(result.hex);
result.free();
} catch (error) {
console.error("WASM error:", error);
}
});
# Build package WebAssembly library
wasm-pack build --release
# Build HTML WebAssembly library
wasm-pack build --release --target web --out-dir pkg-web
# Build WebAssembly library with SIMD support
RUSTFLAGS="-C target-feature=+simd128" wasm-pack build --release --target web
# Serve the demo page
python3 -m http.server