Crate shortguid

Source
Expand description

§shortguid

Provides short, URL-safe UUID representations.

let from_uuid = ShortGuid::try_parse("c9a646d3-9c61-4cb7-bfcd-ee2522c8f633").unwrap();
let from_short = ShortGuid::try_parse("yaZG05xhTLe_ze4lIsj2Mw").unwrap();
assert_eq!(from_uuid, "yaZG05xhTLe_ze4lIsj2Mw");
assert_eq!(from_uuid, from_short);

let random = ShortGuid::new_random();
assert_ne!(from_uuid, random);

§Create features

Other crate features can also be useful beyond the version support:

  • serde - adds the ability to serialize and deserialize a UUID using serde.
  • borsh - adds the ability to serialize and deserialize a UUID using borsh.
  • arbitrary - adds an Arbitrary trait implementation to Uuid for fuzzing.
  • random - adds the ability to generate a random ShortGuids.
  • fast-rng - uses a faster algorithm for generating random ShortGuids. This feature requires more dependencies to compile, but is just as suitable for ShortGuid as the default algorithm. Implies random, enabled by default.
  • bytemuck - adds a Pod trait implementation to Uuid for byte manipulation.

Structs§

ShortGuid
A short, URL-safe UUID representation.

Enums§

ParseError
A parsing error.