Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

hash-wasm-rs

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-wasm-rs

A WebAssembly library for computing file hashes, built with Rust.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

hash-wasm-rs

A WebAssembly library for computing hashes, built with Rust.

Supported algorithms

Name
BLAKE3
MD5
SHA: SHA-224, SHA-256, SHA-384, SHA-512
SHA-3: SHA3-224, SHA3-256, SHA3-384, SHA3-512

Installation

pnpm add hash-wasm-rs

HTML Example usage

Example large file hash calculation

Vite Example usage

pnpm add vite-plugin-wasm

vite.config.ts

import { defineConfig } from "vite";
import wasm from "vite-plugin-wasm";

export default defineConfig(({ mode }) => ({
  plugins: [wasm()],
}));

app.vue

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);
  }
});

Development

# 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

LICENSE

MIT

Keywords

hash

FAQs

Package last updated on 19 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts