Uuid25: 25-digit case-insensitive UUID encoding
Uuid25 is an alternative UUID representation that shortens a UUID string to just 25 digits using the case-insensitive Base36 encoding. This library provides functionality to convert from the conventional UUID formats to Uuid25 and vice versa.
use Uuid25;
// convert from/to string
let a = parse?;
assert_eq!;
assert_eq!;
// convert from/to 128-bit byte array
let b = from;
assert_eq!;
assert_eq!;
// convert from/to uuid crate's Uuid value (enabled by uuid feature)
let uuid_crate = uuid!;
let c = from;
assert_eq!;
assert_eq!;
// convert from/to other popular textual representations
let d = ;
assert_eq!;
let e = parse?;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
// create value in const context
const K: Uuid25 = parse_unwrap;
assert_eq!;
Integration with other crates
This crate implements conversion traits from/into UUID types of other popular crates. To enable
such conversion traits, turn on the corresponding crate features. For example, to enable
conversion from/into uuid::Uuid, put the following entries in Cargo.toml:
[]
= { = "<version>", = ["v4"] }
= { = "<version>", = ["uuid"] }
And then:
use Uuid25;
let x: Uuid25 = new_v4.into;
println!; // e.g. "6n7pvwv8r54xycmuby0pp1q8a"
let y: Uuid = x.into;
println!; // e.g. "703d4a3e-5f1a-473e-90dd-fe20c883780a"
Crate features
Default features:
stdintegrates this crate withstdand enables integration withstd::string::Stringandstd::error::Error. Note that this crate does not rely a lot onstdand most of the functionality of this crate is still available underno_stdenvironments.
Optional features:
serdeenables serialization/deserialization ofUuid25values throughserdeuuidenables conversion traits from/intouuid::Uuidbsonenables conversion traits from/intobson::Uuiduuid7enables conversion traits from/intouuid7::Uuid
License
Licensed under the Apache License, Version 2.0.