A simple utility for hashing JS values with Rust and WebAssembly.
npm install js-hasher-rs
import { hasher } from 'js-hasher-rs';
const valueToHash = "Testing";
const hashed = hasher(valueToHash);
console.log('Hashed:', hashed); // Hashed: 4506850079084803000
There is currently a bug in wasm-pack
causing some of the
generated JS files to go missing from the final package.json
,
breaking the library entirely. A workaround until a fix is released for wasm-pack
is:
- Run
wasm-pack build
as usual. - Add the missing files manually to the
"files":[]
entry inpkg/package.json
. - Bump the version number.
- Run
wasm-pack publish
.