Skip to content

KernelFreeze/random_id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RandomId

Provides a lazy iterator that generates IDs in a random order using the FPE algorithm. It allows to generate IDs that are not sequential but are unique.

Usage

use random_id::RandomIdGenerator;
use rand::prelude::*;

let mut rng = rand::thread_rng();
let mut key = [0u8; 32];
rng.fill(&mut key);

let mut id_generator = RandomIdGenerator::new(key, 1234, 1);

for i in id_generator.take(10) {
   println!("{}", i);
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages