JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q38821F
  • License MIT

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

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hash-wasm-rs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    hash-wasm-rs

    A WebAssembly library for computing hashes, built with Rust.

    Features

    • Supports multiple hash algorithms: SHA-256, SHA-512, SHA3-256, SHA3-512, MD5, BLAKE3.

    Installation

    pnpm add hash-wasm-rs

    Usage

    import initWasm, { HasherWrapper, HashType } from "hash-wasm-rs";
    
    await initWasm();
    
    // Compute hash from text input
    const text = "Hello, world!";
    const result = new HasherWrapper(text, HashType.MD5).result();
    console.log(result.hex);
    
    // Compute hash from file data
    const file = new File(["Hello, world!"], "hello.txt");
    const result = new HasherWrapper(file, HashType.MD5).result();
    console.log(result.hex);

    Development

    # Build WebAssembly library
    wasm-pack build --target web --release
    
    # Serve the demo page
    python3 -m http.server

    LICENSE

    MIT