Check if WASM acceleration is available.
The compiled WebAssembly module, or null if not loaded.
Initialize the WASM module from a .wasm file or buffer.
OptionalwasmSource: BufferSource | ResponseGet current WASM status.
Hash data using WASM-accelerated implementation. Falls back to JS.
Hash algorithm name (e.g. "sha256", "sha512", "blake3").
Raw bytes to hash.
The hash digest as a Uint8Array.
Benchmark an operation: JS vs WASM.
The operation to benchmark.
Number of iterations (default 1000).
Benchmark results with timing and speedup ratio.
Reset the accelerator, releasing the WASM module.
WebAssembly cryptographic accelerator.
When the WASM module is available, routes heavy operations through near-native WASM code. Falls back transparently to the JavaScript implementation when WASM is not loaded.
Auto-detection: crypto-lib checks for this package at import time. If installed, heavy operations are automatically routed through WASM.
Example