Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
/ wasm-sodium Public archive

PoC of libsodium being used in Rust on wasm32-unknown-unknown

Notifications You must be signed in to change notification settings

alexcrichton/wasm-sodium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

PoC of libsodium being used in Rust on wasm32-unknown-unknown

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published