A CLI tool for base64 which supports both native and WebAssembly
Note: This project is a fork of the original Rust implementation: rust-base64.
You can install this using the cargo install
command:
bash
$ cargo install base64-cli
This application also provides a wasm package.
You can install it using wapm
by the following command:
bash
$ wapm install ken-matsui/base64
```bash $ base64-cli --help base64-cli 0.1.0 Ken Matsui <26405363+ken-matsui@users.noreply.github.com> A CLI tool for base64
USAGE:
base64
OPTIONS: -h, --help Print help information -V, --version Print version information
SUBCOMMANDS: decode Decode base64 string to string encode Encode string to base64 string help Print this message or the help of the given subcommand(s) ```
```bash $ wapm run base64 --help base64-cli 0.1.0 Ken Matsui <26405363+ken-matsui@users.noreply.github.com> A CLI tool for base64
USAGE:
base64
OPTIONS: -h, --help Print help information -V, --version Print version information
SUBCOMMANDS: decode Decode base64 string to string encode Encode string to base64 string help Print this message or the help of the given subcommand(s) ```
bash
$ base64-cli encode hello
aGVsbG8=
bash
$ base64-cli decode aGVsbG8=
hello
bash
$ wapm run base64 encode hello
aGVsbG8=
bash
$ wapm run base64 decode aGVsbG8=
hello
bash
$ cargo build
Or you can directly execute the binary:
bash
$ cargo run
bash
$ rustup target add wasm32-wasi
$ cargo build --target wasm32-wasi
$ wasmer run target/wasm32-wasi/debug/base64-cli.wasm encode hello
This command can also test C API.
bash
$ cargo build
$ cargo test
bash
$ git tag v0.1.0
$ git push origin v0.1.0
bash
$ cargo publish
bash
$ cargo build --release --target wasm32-wasi
$ wapm publish