ssimulacra2 计算工具,使用 Rust 编写并构建为 Wasm, 使其可以运行在 Web 端。
Written in Rust, compiled to Wasm, for computing ssimulacra2 in browser or Nodejs environment.
npm package: https://www.npmjs.com/package/calc-s2-rust
Demo: https://calc-s2-vitefe.vercel.app/
Demo code: https://github.com/iola1999/calc-s2-vitefe
wasm-pack build --target web
ssimulacra2 的计算部分依赖 https://github.com/rust-av/ssimulacra2,但因没能关闭的 rayon feature(会导致无法直接跑在浏览器端),故暂时直接复制了代码过来修改。
- https://github.com/GoogleChromeLabs/wasm-bindgen-rayon rayon polyfill