[][src]Module unique_id::random

An implementation that provides random 128-bit unsigned integer values.

Using randomly generated UUIDs these are converted to u128 values for equality testing and ease of storage. This implementation depends upon the uuid crate.

Example

use unique_id::{Generator, GeneratorWithInvalid};
use unique_id::random::RandomGenerator;

let gen = RandomGenerator::default();
let id = gen.next_id();
assert_ne!(id, RandomGenerator::invalid_id())

Structs

RandomGenerator

Generates random u128 values generated from UUIDs. This implementation does provide an invalid value, 0 as u128.