NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io, #101 most downloaded on crates.io
A library to generate and parse UUIDs.
Latest stable
1.29.3
Last release 5 days ago
17 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
12 years old
104 releases · first in 2014
Drag across the ruler to compare, or tap a release to open it.
Accept byte sequences when deserializing with serde::bytes by @yxshee in #930
Full Changelog: v1.29.2...v1.29.3
Support wasm64 in the js feature by @nickbabcock in #928
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Full Changelog: v1.29.1...v1.29.2
Remove some deprecated attrs and resolve Cargo lints by @KodrAus in #921
borsh feature of uuid in favour of a uuid feature in borsh by @KodrAus in #923Full Changelog: v1.29.0...v1.29.1
Add versioned constructors to NonNilUuid by @RanaPriyansh in #919
Full Changelog: v1.28.0...v1.29.0
Add optional serde format adapters by @RanaPriyansh in #916
Full Changelog: v1.27.0...v1.28.0
Accept case-insensitive urn:uuid: prefixes when parsing by @jaideeppyne in #912
Full Changelog: v1.26.1...v1.27.0
Seat the v7 counter below the version nibble by @lenamonj in #907
Add ContextV7::with_additional_precision_bits by @ChrisJr404 in #904
Full Changelog: 1.25.0...v1.26.0
Add a serde::bytes module that encodes a Uuid as a byte string by @ChrisJr404 in #902
Full Changelog: v1.24.1...1.25.0
Fix non-ASCII character handling in parse diagnostics by @questfever in #899
Full Changelog: v1.24.0...v1.24.1
feat(fmt): support encoding into MaybeUninit buffers by @weifanglab in https://github.com/uuid-rs/uuid/pull/892
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.23.5...v1.24.0
doc: Fix broken link by @frostyplanet in https://github.com/uuid-rs/uuid/pull/891
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.23.4...v1.23.5
Fix up name of fuzz script in readme by @KodrAus in https://github.com/uuid-rs/uuid/pull/888
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.23.3...v1.23.4
Fix up parser panic on empty input by @KodrAus in https://github.com/uuid-rs/uuid/pull/886
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.23.2...v1.23.3
Improve error messages for ambiguous formats by @KodrAus in https://github.com/uuid-rs/uuid/pull/882
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.23.1...v1.23.2
Remove deprecated msrv feature from wasm-bindgen dependency by @guybedford in https://github.com/uuid-rs/uuid/pull/877
msrv feature from wasm-bindgen dependency by @guybedford in https://github.com/uuid-rs/uuid/pull/877Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.23.0...v1.23.1
This release includes the following deprecations:
@meng-xu-cs raised a series of bugs against the timestamp logic in uuid using automated tooling. The issues themselves were reasonably and responsibly presented and the end result is a better uuid library for everyone. Thanks!
This release includes the following deprecations:
Context: Renamed to ContextV1Timestamp::from_gregorian: Renamed to Timestamp::from_gregorian_timeVersion::MaxVersion::Max's u8 representation has changed from 0xff to 0x0f to match the value returned by Uuid::get_version_num.
Uuid::get_version for the max UUIDUuid::get_version will only return Some(Version::Max) if the UUID is actually the max UUID (all bytes are 0xff). Previously it would return Some if only the version field was 0x0f. This change matches the behaviour of the nil UUID, which only returns Some(Version::Nil) if the UUID is the nil UUID (all bytes are 0x00).
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.22.0...v1.23.0
Default to rand 0.10 by @haxtibal in https://github.com/uuid-rs/uuid/pull/863
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.21.0...v1.22.0
Update getrandom to 0.4 by @KodrAus in https://github.com/uuid-rs/uuid/pull/858
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.20.0...v1.21.0
Deprecate macro-diagnostics by @KodrAus in https://github.com/uuid-rs/uuid/pull/856
macro-diagnostics by @KodrAus in https://github.com/uuid-rs/uuid/pull/856Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.19.0...v1.20.0
Switch serde dependency to serde_core by @paolobarbolini in https://github.com/uuid-rs/uuid/pull/843
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.18.1...v1.19.0
Unsafe cleanup by @KodrAus in https://github.com/uuid-rs/uuid/pull/841
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.18.0...v1.18.1
Fix up mismatched_lifetime_syntaxes lint by @KodrAus in https://github.com/uuid-rs/uuid/pull/837
Timestamp and std::time::SystemTime by @dcormier in https://github.com/uuid-rs/uuid/pull/835Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.17.0...v1.18.0
Added convenience implementation TryFrom for std by @Nahuel-M in https://github.com/uuid-rs/uuid/pull/819
wasm32v1-none Support by @bushrat011899 in https://github.com/uuid-rs/uuid/pull/828Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.16.0...v1.17.0
Mark Uuid::new_v8 const by @tguichaoua in https://github.com/uuid-rs/uuid/pull/815
Uuid::new_v8 const by @tguichaoua in https://github.com/uuid-rs/uuid/pull/815Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.15.1...v1.16.0
Guarantee v7 timestamp will never overflow by @KodrAus in https://github.com/uuid-rs/uuid/pull/811
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.15.0...v1.15.1
Add a manual Debug implementation for NonNilUUid by @rick-de-water in https://github.com/uuid-rs/uuid/pull/808
Debug implementation for NonNilUUid by @rick-de-water in https://github.com/uuid-rs/uuid/pull/808Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.14.0...v1.15.0
Add FromStr impls to the fmt structs by @tysen in https://github.com/uuid-rs/uuid/pull/806
Full Changelog: https://github.com/uuid-rs/uuid/compare/v1.13.2...v1.14.0
Add a compile_error when no source of randomness is available on wasm32-unknown-unknown by @KodrAus in https://github.com/uuid-rs/uuid/pull/804
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.13.1...v1.13.2
Fix wasm32 with atomics by @bushrat011899 in https://github.com/uuid-rs/uuid/pull/797
wasm32 with atomics by @bushrat011899 in https://github.com/uuid-rs/uuid/pull/797Full Changelog: https://github.com/uuid-rs/uuid/compare/1.13.0...1.13.1
This release updates our version of getrandom to 0.3 and rand to 0.9. It is a potentially breaking change for the following users:
This release updates our version of getrandom to 0.3 and rand to 0.9. It is a potentially breaking change for the following users:
rng featureuuid still uses getrandom by default on these platforms. Upgrade your version of getrandom and follow its new docs on configuring a custom backend.
wasm32-unknown-unknown users who enable the rng feature without the js featureUpgrade your version of getrandom and follow its new docs on configuring a backend.
You'll also need to enable the rng-getrandom or rng-rand feature of uuid to force it to use getrandom as its backend:
[dependencies.uuid]
version = "1.13.0"
- features = ["v4"]
+ features = ["v4", "rng-getrandom"]
[dependencies.getrandom]
version = "0.3"
If you're on wasm32-unknown-unknown and using the js feature of uuid you shouldn't see any breakage. We've kept this behavior by vendoring in getrandom's web-based backend when the js feature is enabled.
getrandom to 0.3 and rand to 0.9 by @KodrAus in https://github.com/uuid-rs/uuid/pull/793getrandom on wasm32-unknown-unknown without JavaScript by @KodrAus in https://github.com/uuid-rs/uuid/pull/794Full Changelog: https://github.com/uuid-rs/uuid/compare/1.12.1...1.13.0
Fix links to namespaces in documentation by @cstyles in https://github.com/uuid-rs/uuid/pull/789
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.12.0...1.12.1
This release includes additional PartialEq implementations on Uuid, which can break inference in some cases.
This release includes additional PartialEq implementations on Uuid, which can break inference in some cases.
NonZeroUuid type for optimized Option<Uuid> representation by @ab22593k in https://github.com/uuid-rs/uuid/pull/779NonNilUuid by @KodrAus in https://github.com/uuid-rs/uuid/pull/783Full Changelog: https://github.com/uuid-rs/uuid/compare/1.11.1...1.12.0
Finish cut off docs by @KodrAus in https://github.com/uuid-rs/uuid/pull/777
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.11.0...1.11.1
Upgrade zerocopy to 0.8 by @yotamofek in https://github.com/uuid-rs/uuid/pull/771
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.10.0...1.11.0
This release deprecates and renames the following functions:
This release deprecates and renames the following functions:
Builder::from_rfc4122_timestamp -> Builder::from_gregorian_timestampBuilder::from_sorted_rfc4122_timestamp -> Builder::from_sorted_gregorian_timestampTimestamp::from_rfc4122 -> Timestamp::from_gregorianTimestamp::to_rfc4122 -> Timestamp::to_gregorianFull Changelog: https://github.com/uuid-rs/uuid/compare/1.9.1...1.10.0
Add an example of generating bulk v7 UUIDs by @KodrAus in https://github.com/uuid-rs/uuid/pull/761
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.9.0...1.9.1
Before this release, Uuid::now_v7() would only use the millisecond-precision timestamp for ordering. It now also uses a global 42-bit counter that's r
Uuid::now_v7() is guaranteed to be monotonicBefore this release, Uuid::now_v7() would only use the millisecond-precision timestamp for ordering. It now also uses a global 42-bit counter that's re-initialized each millisecond so that the following will always pass:
let a = Uuid::now_v7();
let b = Uuid::now_v7();
assert!(a < b);
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.8.0...1.9.0
A new impl AsRef for Uuid bound has been added, which can break inference on code like:
A new impl AsRef<Uuid> for Uuid bound has been added, which can break inference on code like:
let b = uuid.as_ref();
You can fix these by explicitly typing the result of the conversion:
let b: &[u8] = uuid.as_ref();
or by calling as_bytes instead:
let b = uuid.as_bytes();
wasm-bindgen as a dependency on wasm32-unknown-unknown by @emilk in https://github.com/uuid-rs/uuid/pull/738Full Changelog: https://github.com/uuid-rs/uuid/compare/1.7.0...1.8.0
Add missing test for invalid parse_str by @CXWorks in https://github.com/uuid-rs/uuid/pull/723
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.6.1...1.7.0
Fix uuid macro in consts by @KodrAus in https://github.com/uuid-rs/uuid/pull/721
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.6.0...1.6.1
doc: fix links in v6 module by @metalalive in https://github.com/uuid-rs/uuid/pull/714
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.5.0...1.6.0
Add impl From for String under the std feature flag by @brahms116 in https://github.com/uuid-rs/uuid/pull/700
bytemuck support by @John-Toohey in https://github.com/uuid-rs/uuid/pull/711Full Changelog: https://github.com/uuid-rs/uuid/compare/1.4.1...1.5.0
Fix macro hygiene by @teohhanhui in https://github.com/uuid-rs/uuid/pull/694
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.4.0...1.4.1
Fixed wasm tests not running due to incorrect attribute target by @kmusick in https://github.com/uuid-rs/uuid/pull/688
borsh support by @grovesNL in https://github.com/uuid-rs/uuid/pull/686Full Changelog: https://github.com/uuid-rs/uuid/compare/1.3.4...1.4.0
Add wasm32-wasi support with tests by @acfoltzer in https://github.com/uuid-rs/uuid/pull/677
wasm32-wasi support with tests by @acfoltzer in https://github.com/uuid-rs/uuid/pull/677Full Changelog: https://github.com/uuid-rs/uuid/compare/1.3.3...1.3.4
Hard deprecate Timestamp::to_unix_nanos by @KodrAus in https://github.com/uuid-rs/uuid/pull/673
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.3.2...1.3.3
Create SECURITY.md by @KodrAus in https://github.com/uuid-rs/uuid/pull/668
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.3.1...1.3.2
Update syn requirement from 1.0.80 to 2.0.5 by @dependabot in https://github.com/uuid-rs/uuid/pull/663
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.3.0...1.3.1
Fix error message. by @basbossink-ds in https://github.com/uuid-rs/uuid/pull/656
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.2.2...1.3.0
CI Cleanups by @KodrAus in https://github.com/uuid-rs/uuid/pull/640
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.2.1...1.2.2
Fix up lost re-export of v1 Timestamp by @KodrAus in https://github.com/uuid-rs/uuid/pull/636
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.2.0...1.2.1
formatting changes by @pintariching in https://github.com/uuid-rs/uuid/pull/610
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.1.2...1.2.0
Fix some doc links by @mbrobbel in https://github.com/uuid-rs/uuid/pull/606
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.1.1...1.1.2
Fix documentation typo by @nstinus in https://github.com/uuid-rs/uuid/pull/603
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.1.0...1.1.1
note that the Error display impl is public API by @KodrAus in https://github.com/uuid-rs/uuid/pull/597
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.0.0...1.1.0
This release includes a _huge_ amount of work from a lot of contributors. These notes are duplicated from 1.0.0-alpha.1 since they're relevant for any
This release includes a huge amount of work from a lot of contributors. These notes are duplicated from 1.0.0-alpha.1 since they're relevant for anybody moving from 0.8.2 to 1.0.0.
https://github.com/uuid-rs/uuid/compare/0.8.2...main
@Gaelan @hecsalazarf @Expyron @saiintbrisson @tshepang @Tehnix @Takashiidobe @A248 @clehner
With a special thanks to:
@kinggoesgaming @QnnOkabayashi @Nugine
Parsing and formatting methods are now much faster, and work in const too! On my i9 9900K Windows desktop, the difference looks something like this:
| Case | 1.0.0-alpha.1 |
0.8.3 |
|---|---|---|
| parse_invalid_character | 40 ns/iter (+/- 0) | 39 ns/iter (+/- 1) |
| parse_invalid_group_len | 47 ns/iter (+/- 1) | 52 ns/iter (+/- 5) |
| parse_invalid_groups | 58 ns/iter (+/- 1) | 58 ns/iter (+/- 0) |
| parse_invalid_len | 57 ns/iter (+/- 2) | 6 ns/iter (+/- 0) |
| parse_nil | 16 ns/iter (+/- 0) | 50 ns/iter (+/- 4) |
| parse_nil_hyphenated | 17 ns/iter (+/- 0) | 59 ns/iter (+/- 2) |
| parse_random | 16 ns/iter (+/- 0) | 42 ns/iter (+/- 1) |
| parse_random_hyphenated | 18 ns/iter (+/- 0) | 51 ns/iter (+/- 2) |
| parse_urn | 18 ns/iter (+/- 0) | 51 ns/iter (+/- 1) |
You can go one step further and look at the uuid-simd library for vectorized UUID parsing. It's fast!
You can create UUIDs at compile time using the uuid! macro:
#[macro_use]
extern crate uuid;
use uuid::Uuid;
const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");
Enable the macro-diagnostics crate feature to get better diagnostics from uuid! using a procedural macro.
adapter::compactThis module can now be found in serde::compact. It can be combined with #[serde(with)] to serialize a Uuid using a more compact representation. We originally moved to this representation directly, but discovered it comes with its own drawbacks that aren't suitable for all formats.
The following methods have been changed to accept a &[u8; N] instead of a &[u8], making them infallible instead of returning a Result:
Uuid::from_fieldsUuid::from_fields_leUuid::new_v1Builder::from_fieldsBuilder::from_fields_leget_variantThe Uuid::get_variant method now returns a Variant instead of an Option<Varaint>, because it's not actually possible for it to ever be None.
Uuid::to_timestamp is now Uuid::get_timestampThe Uuid::to_timestamp method has been renamed to Uuid::get_timestamp to make it more consistent with Uuid::get_version and Uuid::get_variant.
The following methods that produce formatting adapters have been renamed:
Uuid::to_hyphenated -> Uuid::hyphenatedUuid::to_simple -> Uuid::simpleUuid::to_urn -> Uuid::urnThe following types have been removed:
HyphenatedRefSimpleRefUrnRefThe following methods have been changed to return a &<AdapterType> instead of an <AtapterType>Ref:
Uuid::to_hyphenated_ref -> Uuid::as_hyphenatedUuid::to_simple_ref -> Uuid::as_simpleUuid::to_urn_ref -> Uuid::as_urnBuilder method consistencyThe Builder::build method has been renamed to Builder::into_uuid, to complement the <AdapterType>::into_uuid methods. It also gets an equivalent Builder::as_uuid method.
Version and Variant are non-exhaustiveThe #[non_exhaustive] attribute has been added to Version and Variant. There are already active proposals for new UUID versions, so these are likely to continue evolving in the future.
winapi supportThe Uuid::to_guid and Uuid::from_guid methods have been removed. This was done for two reasons:
winapi types in the stable uuid public API.There are some examples in the repository root that demonstrate how to convert GUIDs into UUIDs as a replacement.
--all-featuresNow that uuid includes unstable features, if you're building with --all-features (such as in package manager scenarios), you'll also need to pass RUSTFLAGS="--cfg uuid_unstable", or you'll end up with compilation errors. If this strategy becomes problematic for users we can change unstable features to silently no-op instead of cause compilation failures if the corresponding cfg is not also supplied. Please reach out if that affects you!
With uuid 1.0 we'll try to stay on that version "forever". There won't be a 2.0 unless there's a very compelling need for it. That means you should feel safe depending on Uuid in the public API of your libraries if you want to.
This release includes a _huge_ amount of work from a lot of contributors. I'll try call out breakage here as well as in release notes once we're ready
This release includes a huge amount of work from a lot of contributors. I'll try call out breakage here as well as in release notes once we're ready to merge so everyone knows what to expect.
https://github.com/uuid-rs/uuid/compare/0.8.2...main
@Gaelan @hecsalazarf @Expyron @saiintbrisson @tshepang @Tehnix @Takashiidobe
With a special thanks to:
@kinggoesgaming @QnnOkabayashi @Nugine
Parsing and formatting methods are now much faster, and work in const too! On my i9 9900K Windows desktop, the difference looks something like this:
| Case | 1.0.0-alpha.1 |
0.8.3 |
|---|---|---|
| parse_invalid_character | 40 ns/iter (+/- 0) | 39 ns/iter (+/- 1) |
| parse_invalid_group_len | 47 ns/iter (+/- 1) | 52 ns/iter (+/- 5) |
| parse_invalid_groups | 58 ns/iter (+/- 1) | 58 ns/iter (+/- 0) |
| parse_invalid_len | 57 ns/iter (+/- 2) | 6 ns/iter (+/- 0) |
| parse_nil | 16 ns/iter (+/- 0) | 50 ns/iter (+/- 4) |
| parse_nil_hyphenated | 17 ns/iter (+/- 0) | 59 ns/iter (+/- 2) |
| parse_random | 16 ns/iter (+/- 0) | 42 ns/iter (+/- 1) |
| parse_random_hyphenated | 18 ns/iter (+/- 0) | 51 ns/iter (+/- 2) |
| parse_urn | 18 ns/iter (+/- 0) | 51 ns/iter (+/- 1) |
You can go one step further and look at the uuid-simd library for vectorized UUID parsing. It's fast!
You can create UUIDs at compile time using the uuid! macro:
#[macro_use]
extern crate uuid;
use uuid::Uuid;
const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");
Enable the macro-diagnostics crate feature to get better diagnostics from uuid! using a procedural macro.
adapter::compactThis module can now be found in serde::compact. It can be combined with #[serde(with)] to serialize a Uuid using a more compact representation. We originally moved to this representation directly, but discovered it comes with its own drawbacks that aren't suitable for all formats.
The following methods have been changed to accept a &[u8; N] instead of a &[u8], making them infallible instead of returning a Result:
Uuid::from_fieldsUuid::from_fields_leUuid::new_v1Builder::from_fieldsBuilder::from_fields_leget_variantThe Uuid::get_variant method now returns a Variant instead of an Option<Varaint>, because it's not actually possible for it to ever be None.
Uuid::to_timestamp is now Uuid::get_timestampThe Uuid::to_timestamp method has been renamed to Uuid::get_timestamp to make it more consistent with Uuid::get_version and Uuid::get_variant.
The following methods that produce formatting adapters have been renamed:
Uuid::to_hyphenated -> Uuid::hyphenatedUuid::to_simple -> Uuid::simpleUuid::to_urn -> Uuid::urnThe following types have been removed:
HyphenatedRefSimpleRefUrnRefThe following methods have been changed to return a &<AdapterType> instead of an <AtapterType>Ref:
Uuid::to_hyphenated_ref -> Uuid::as_hyphenatedUuid::to_simple_ref -> Uuid::as_simpleUuid::to_urn_ref -> Uuid::as_urnBuilder method consistencyThe Builder::build method has been renamed to Builder::into_uuid, to complement the <AdapterType>::into_uuid methods. It also gets an equivalent Builder::as_uuid method.
Version and Variant are non-exhaustiveThe #[non_exhaustive] attribute has been added to Version and Variant. There are already active proposals for new UUID versions, so these are likely to continue evolving in the future.
winapi supportThe Uuid::to_guid and Uuid::from_guid methods have been removed. This was done for two reasons:
winapi types in the stable uuid public API.There are some examples in the repository root that demonstrate how to convert GUIDs into UUIDs as a replacement.
--all-featuresNow that uuid includes unstable features, if you're building with --all-features (such as in package manager scenarios), you'll also need to pass RUSTFLAGS="--cfg uuid_unstable", or you'll end up with compilation errors. If this strategy becomes problematic for users we can change unstable features to silently no-op instead of cause compilation failures if the corresponding cfg is not also supplied. Please reach out if that affects you!
Once uuid releases 1.0 we'll try to stay on that version "forever". There won't be a 2.0 unless there's a very compelling need for it. That means you should feel safe depending on Uuid in the public API of your libraries if you want to.
The 0.8.x releases are now tracked on the 0.8.x branch of uuid. The main branch now contains breaking changes.
This release includes a large number of internal refactorings and changes to dependencies.
The 0.8.x releases are now tracked on the 0.8.x branch of uuid. The main branch now contains breaking changes.
md5 to 0.7 (#442)getrandom instead of rand (#447)serde_derive (#478)Uuid #[repr(transparent)] (#468)rand crate (#489)getrandom to 0.2.0 (#501)This release doesn't contain any source changes, it fixes up errors in the docs, adds clarification and more examples.
This release doesn't contain any source changes, it fixes up errors in the docs, adds clarification and more examples.
One column per quarter.