UUID in WebAssembly

Public Library0.2.1updated 2 months ago633.54 KB
COPY
wapm install ken-matsui/uuid

Need help using WAPM?

Get started here

Commands

uuid

Files

  • Readme.md

Modules

uuid-v4-cli

A CLI tool to generate UUID V4 which supports both native and WebAssembly

Note: This project is a fork of the original Rust implementation: uuid-rs.

Installation

You can install this using the cargo install command:

$ cargo install uuid-v4-cli

WebAssembly

This application also provides a wasm package. You can install it using wapm by the following command:

wapm install ken-matsui/uuid

Usage

uuid --help
uuid-v4-cli 0.1.1
Ken Matsui <26405363+ken-matsui@users.noreply.github.com>
A CLI tool to generate UUID V4

USAGE:
    uuid [OPTIONS]

OPTIONS:
    -h, --hyphenated    Show with hyphens
        --help          Print help information
    -u, --uppercase     Show as uppercase (default: lowercase)
        --urn           Show as a urn
    -V, --version       Print version information

WebAssembly

wapm run uuid -- --help
uuid-v4-cli 0.1.1
Ken Matsui <26405363+ken-matsui@users.noreply.github.com>
A CLI tool to generate UUID V4

USAGE:
    uuid [OPTIONS]

OPTIONS:
    -h, --hyphenated    Show with hyphens
        --help          Print help information
    -u, --uppercase     Show as uppercase (default: lowercase)
        --urn           Show as a urn
    -V, --version       Print version information

Examples

Simple UUID

uuid
4611494855814da2a559fd0d6d422766

with uppercase

uuid -u
4D41163F06F7404BBB3A6C357062DAE0

Hyphenated UUID

uuid -h
b6dc2c9c-6408-433f-8e5b-f91677cad729

with uppercase

uuid -h -u
2FBC671A-3BD9-4BDC-B5B2-95C18CBEF900

Urn UUID

uuid --urn
urn:uuid:9756279b-886a-4bc7-83ae-cefe69e8397e

with uppercase

uuid --urn -u
urn:uuid:5B91ECE3-A85D-481E-BA45-69AC04ECC0F0

WebAssembly

Simple UUID

wapm run uuid
4611494855814da2a559fd0d6d422766

with uppercase

wapm run uuid -- -u
4D41163F06F7404BBB3A6C357062DAE0

Hyphenated UUID

wapm run uuid -- -h
b6dc2c9c-6408-433f-8e5b-f91677cad729

with uppercase

wapm run uuid -- -h -u
2FBC671A-3BD9-4BDC-B5B2-95C18CBEF900

Urn UUID

wapm run uuid -- --urn
urn:uuid:9756279b-886a-4bc7-83ae-cefe69e8397e

with uppercase

wapm run uuid -- --urn -u
urn:uuid:5B91ECE3-A85D-481E-BA45-69AC04ECC0F0

Contribution

Build

$ cargo build

Or you can directly execute the binary:

$ cargo run

WebAssembly

$ rustup target add wasm32-wasi
$ cargo build --target wasm32-wasi
$ wasmer run target/wasm32-wasi/debug/uuid.wasm

Test

This command can also test C API.

$ cargo build
$ cargo test

Publish

GitHub Releases

$ git tag v0.1.0
$ git push origin v0.1.0

crates.io

$ cargo publish

wapm.io

$ cargo build --release --target wasm32-wasi
wapm publish

<1klast week

Latest version

0.2.1

Latest updated

2 months ago

Unpackaged size

633.54 KB

License

MIT

Collaborators

    Run it in the browser