uuidx is an R package for generating and working with
modern UUIDs using a Rust backend. It focuses on a small, practical API
and uses the Rust uuid crate
through rextendr
and extendr.
The package is developed by Thomas Bryce Kelly and published as part of Icy Seas Co-Laboratory, an applied research and engineering institute focused on practical computational tools, data systems, and scientific software and based in Fairbanks, AK.
Icy Seas Co-Laboratory is the
home organization behind uuidx. If you are using this
package in research, engineering, or production workflows and want more
context on the broader work around it, the project site is the best
place to start.
uuid crate gives us current RFC 9562 behavior
without relying on a system package such as libuuid.Version 7 UUIDs combine time-ordering with strong uniqueness properties and are generally a practical default for new application identifiers. They sort more naturally than version 4 identifiers. Users should familiarize themselves with the structure and trade-offs associated with each version (e.g., Wikipedia).
End users installing CRAN binaries on macOS or Windows typically do not need a local Rust toolchain. Rust is mainly needed for source installs and package development.
Install Rust first if it is not already available:
Then install the R-side development dependencies:
install.packages(c("rextendr", "testthat"), repos = "https://cloud.r-project.org")From the package root:
Rscript -e 'rextendr::document()'
Rscript -e 'testthat::test_local()'
R CMD build .
R CMD check --as-cran uuidx_*.tar.gzFor quick local iteration:
rextendr::document()
testthat::test_local()You can also use the included Makefile:
make deps
make document
make test
make build
make checkuuid_v7()
uuid_v7(3)
uuid_generate()uuid_v4()
uuid_generate(5, version = "v4")uuid_v5("dns", "example.com")
uuid_v5("dns", c("alpha", "beta"))
uuid_generate(version = "v5", namespace = "dns", name = "example.com")x = c(uuid_v7(), "not-a-uuid")
uuid_validate(x)
uuid_version(x)x = uuid_v7(2)
uuid_parse(x, output = "raw")
uuid_parse(x, output = "fields")
uuid_nil(output = "raw")