
Faithful line-by-line transliteration of a UUID implementation enabling generation, parsing, formatting, version handling, and per-file provenance headers for traceability, aiming feature parity with upstream.
This is a Kotlin Multiplatform line-by-line transliteration port of uuid-rs/uuid.
Original Project: This port is based on uuid-rs/uuid. All design credit and project intent belong to the upstream authors; this repository is a faithful port to Kotlin Multiplatform with no behavioural changes intended.
This is an in-progress port. The goal is feature parity with the upstream Rust crate while providing a native Kotlin Multiplatform API. Every Kotlin file carries a // port-lint: source <path> header naming its upstream Rust counterpart so the AST-distance tool can track provenance.
The text below is reproduced and lightly edited from
https://github.com/uuid-rs/uuid. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs so they continue to resolve from this repository.
Here's an example of a UUID:
67e55044-10b1-426f-9247-bb680e5fe0c8
A UUID is a unique 128-bit value, stored as 16 octets, and regularly formatted as a hex string in five groups. UUIDs are used to assign unique identifiers to entities without requiring a central allocating authority.
They are particularly useful in distributed systems, though can be used in disparate areas, such as databases and network protocols. Typically a UUID is displayed in a readable string form as a sequence of hexadecimal digits, separated into groups by hyphens.
The uniqueness property is not strictly guaranteed, however for all practical purposes, it can be assumed that an unintentional collision would be extremely unlikely.
Add the following to your Cargo.toml:
[dependencies.uuid]
version = "1.23.1"
# Lets you generate random UUIDs
features = [
"v4",
]When you want a UUID, you can generate one:
use uuid::Uuid;
let id = Uuid::new_v4();If you have a UUID value, you can use its string literal form inline:
use uuid::{uuid, Uuid};
const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");You can also parse UUIDs without needing any crate features:
use uuid::{Uuid, Version};
let my_uuid = Uuid::parse_str("67e55044-10b1-426f-9247-bb680e5fe0c8")?;
assert_eq!(Some(Version::Random), my_uuid.get_version());If you'd like to parse UUIDs really fast, check out the uuid-simd
library.
For more details on using uuid, see the library documentation.
uuid library docs.Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
dependencies {
implementation("io.github.kotlinmania:uuid-kotlin:0.1.1")
}./gradlew build
./gradlew testSee AGENTS.md and CLAUDE.md for translator discipline, port-lint header convention, and Rust → Kotlin idiom mapping.
This Kotlin port is distributed under the same Apache-2.0 license as the upstream uuid-rs/uuid. See LICENSE (and any sibling LICENSE-* / NOTICE files mirrored from upstream) for the full text.
Original work copyrighted by the uuid authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the uuid-rs/uuid maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.
This is a Kotlin Multiplatform line-by-line transliteration port of uuid-rs/uuid.
Original Project: This port is based on uuid-rs/uuid. All design credit and project intent belong to the upstream authors; this repository is a faithful port to Kotlin Multiplatform with no behavioural changes intended.
This is an in-progress port. The goal is feature parity with the upstream Rust crate while providing a native Kotlin Multiplatform API. Every Kotlin file carries a // port-lint: source <path> header naming its upstream Rust counterpart so the AST-distance tool can track provenance.
The text below is reproduced and lightly edited from
https://github.com/uuid-rs/uuid. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs so they continue to resolve from this repository.
Here's an example of a UUID:
67e55044-10b1-426f-9247-bb680e5fe0c8
A UUID is a unique 128-bit value, stored as 16 octets, and regularly formatted as a hex string in five groups. UUIDs are used to assign unique identifiers to entities without requiring a central allocating authority.
They are particularly useful in distributed systems, though can be used in disparate areas, such as databases and network protocols. Typically a UUID is displayed in a readable string form as a sequence of hexadecimal digits, separated into groups by hyphens.
The uniqueness property is not strictly guaranteed, however for all practical purposes, it can be assumed that an unintentional collision would be extremely unlikely.
Add the following to your Cargo.toml:
[dependencies.uuid]
version = "1.23.1"
# Lets you generate random UUIDs
features = [
"v4",
]When you want a UUID, you can generate one:
use uuid::Uuid;
let id = Uuid::new_v4();If you have a UUID value, you can use its string literal form inline:
use uuid::{uuid, Uuid};
const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");You can also parse UUIDs without needing any crate features:
use uuid::{Uuid, Version};
let my_uuid = Uuid::parse_str("67e55044-10b1-426f-9247-bb680e5fe0c8")?;
assert_eq!(Some(Version::Random), my_uuid.get_version());If you'd like to parse UUIDs really fast, check out the uuid-simd
library.
For more details on using uuid, see the library documentation.
uuid library docs.Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
dependencies {
implementation("io.github.kotlinmania:uuid-kotlin:0.1.1")
}./gradlew build
./gradlew testSee AGENTS.md and CLAUDE.md for translator discipline, port-lint header convention, and Rust → Kotlin idiom mapping.
This Kotlin port is distributed under the same Apache-2.0 license as the upstream uuid-rs/uuid. See LICENSE (and any sibling LICENSE-* / NOTICE files mirrored from upstream) for the full text.
Original work copyrighted by the uuid authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the uuid-rs/uuid maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.