alibi_core/utils/id.rs
1//! Random opaque verification identifiers. Physical model primary IDs remain
2//! the responsibility of the application's database schema.
3use rand::RngExt;
4
5#[must_use]
6pub fn generate_id(length: usize) -> String {
7 rand::rng()
8 .sample_iter(rand::distr::Alphanumeric)
9 .take(length)
10 .map(char::from)
11 .collect()
12}