All Projects → alexcrichton → wasm-sodium

alexcrichton / wasm-sodium

Licence: other
PoC of libsodium being used in Rust on wasm32-unknown-unknown

Programming Languages

rust
11053 projects
shell
77523 projects
javascript
184084 projects - #8 most used programming language

wasm32-unknown-unknown and sodiumoxide

A proof-of-concept repository showing how libsodium and the sodiumoxide bindings can be used in the browser with the wasm32-unknown-unknown target.

To test this out you'll need:

  • A Linux machine
  • The docker command
  • A nightly Rust compiler (rustup update nightly)
  • The wasm32 target (rustup target add wasm32-unknown-unknown)
  • The wasm-bindgen CLI command (cargo install wasm-bindgen-cli)
  • Node.js with wasm support

And with all that in place you can execute the example with:

./build.sh

And you should see something like:

...
+ node run.js
10 randomly generated bytes are [132, 50, 0, 212, 16, 153, 236, 63, 8, 107]
sha256("Hello, World!") = dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].