uuid
Generated by tinox doc
RFC 4122 version 4 (random) UUID generation, formatting and validation. Uuid::generate() returns a new random UUID as a hyphenated hex string; Uuid::isValid checks a string matches the canonical 8-4-4-4-12 UUID shape.
| Module | Version | Group |
|---|---|---|
random | 1.0.0 | tinox.core |
Generate and validate
import tinox.core.uuid;
class Main
{
fnc main() -> Int32
{
let id: String = Uuid::generate();
println(id);
println(Uuid::isValid(id).toString());
println(Uuid::isValid("not-a-uuid").toString());
return 0;
}
}
class Uuid
Fields
value | String |
Methods
fn nibbleToHex(n: Int64) → String
fn byteToHex(b: Int64) → String
fn generate() → String
fn fromString(s: String) → Uuid
fn toString() → String
fn isValid(s: String) → Bool