Skip to content

osenvosem/rust-wasm-example

Repository files navigation

Example of using WebAssembly module on the web

The purpose of the project is to demonstrate how to use WASM written in Rust in the browser, particularly how to invoke a Rust function from the Javascript side and the other way around.

On the Javascript side we execute a Rust function passing a string converted to Uint8Array to it. The function generates a hash, invokes Javascript's console.log passing the hash into it and returns the hash. After that the hash renders on the page with additional information.

Run the project

npm install
npm start

Screenshot

Project screenshot