alibi-core 0.5.0

Shared authentication contracts and backend-independent services for Alibi
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Random opaque verification identifiers. Physical model primary IDs remain
//! the responsibility of the application's database schema.
use rand::RngExt;

#[must_use]
pub fn generate_id(length: usize) -> String {
    rand::rng()
        .sample_iter(rand::distr::Alphanumeric)
        .take(length)
        .map(char::from)
        .collect()
}