name | slug | description | framework | useCase | css | deployUrl | demoUrl | relatedTemplates | ||
---|---|---|---|---|---|---|---|---|---|---|
WASM Rust XOR Exclusive Or Example |
edge-wasm-rust-xor |
Perform XOR bitwise operations in your API with Rust and WebAssembly using Edge Functions. |
None |
Edge Function |
None |
|
Perform XOR bitwise operations in your API with Rust and WebAssembly using Edge Functions.
This examples takes two 32-bit numbers as inputs (the a
and b
query parameters) and uses a WASM function written in Rust to exclusive or them.
https://wasm-rust-xor.vercel.app/api/xor?a=0xac38b505&b=0x83ba94e4
You can choose from one of the following two methods to use this repository:
Deploy the example using Vercel:
Execute create-next-app
with npm or Yarn to bootstrap the example:
npx create-next-app --example https://github.com/vercel/examples/tree/main/edge-functions/wasm-rust-xor edge-wasm-rust-xor
# or
yarn create next-app --example https://github.com/vercel/examples/tree/main/edge-functions/wasm-rust-xor edge-wasm-rust-xor
To build and run the example locally, you'll need to install the following prerequisites:
- Rust: The API Route for this example is written in Rust and requires the Rust toolchain to build.
wasm-pack
: is a helpful utility that builds, optimizes and packages Rust into WebAssembly. This example uses it for the build and optimization step (although it does not use it for packaging).
Then, install the Vercel CLI which you'll use to run the app:
npm i -g vercel
Run the app at the root of the repository:
vercel dev
Deploy it to the cloud with Vercel (Documentation).