# install rustup
curl https://sh.rustup.rs -sSf | sh
# use nightly version
rustup install nightly-2018-06-05
rustup target add wasm32-unknown-unknown --toolchain nightly
To Compile the rust crypto to a Web Assembly (WASM) module and build JS library run the ./build
script.
(only necessary if you want to build locally)
There is a simple example application in js-example
that can be run to test some of the features.
within js-example/
folder
npm install
npm run install
within js-example/
run npm run build
open js-example/index.html
in any browser
You can either build the library locally on your machine to test the latest version with your project or install via NPM.
in the root of this repo: npm link
in the root of your project: npm link rust-cardano-crypto
in the root of your project: npm install rust-cardano-crypto
// Import like this:
import CardanoCrypto from 'rust-cardano-crypto'
// Or access as global in browsers:
CardanoCrypto.PaperWallet.scramble(iv, password, input)
The rust code contains rwc/
a fork of rust-crypto
without the dependencies that cannot be build easily in a wasm environment, and minus the
algorithms that are not useful.