Crates.io | ruuid |
lib.rs | ruuid |
version | 0.1.6 |
source | src |
created_at | 2023-03-01 18:58:28.704774 |
updated_at | 2023-03-01 20:12:36.151906 |
description | Cli tool to generate UUIDs |
homepage | |
repository | https://github.com/westernwontons/ruuid |
max_upload_size | |
id | 798236 |
size | 22,316 |
I couldn't find a tool that generates uuid's of various formats conveniently and programatically over the cli and rUUID was born. Necessity is the mother of "I can't find it, I'll make it".
This crate only depends on uuid
and clap
crates.
Since for uuid version 6, 7 and 8 the uuid
crate needs to be compiled with RUSTFLAGS="--cfg uuid_unstable"
. For you, this means when you install ruuid
, you need to pass
that unless you want compilation errors. For example:
RUSTFLAGS="--cfg uuid_unstable" cargo install ruuid
or
RUSTFLAGS="--cfg uuid_unstable" cargo install --git https://github.com/westernwontons/ruuid
There are subcommands for each type of supported uuid's. Any uuid formats supported by uuid
are supported by rUUID
as well.
For example, to generate a UUID_V1:
ruuid v1
To generate a version 1 UUID with the braced format:
ruuid v1 -b
You can pass a number to tell ruuid
how many UUIDs you want generated:
ruuid v1 3
The default number of UUIDs generated is 1.
The following UUIDs are supported:
Version 1, 3, 5, 6 and 8 need some random bytes to be generated, namely 6 pieces of u8
(except for version 8 which needs 16 u8
s).
These are generated with the help of the rand crate. Honestly I have no ideas whether is sufficient, if it's not, let me know.
Version 3 and 5 implicitly use the DNS namespace. I don't know whether it would be preferable to have that configurable. It's static for know. If you'd like that changed, let me know.