ids_service 2.1.3

Library that allows to generate unique Ids.
Documentation
// SPDX-License-Identifier: MIT
//! Quick start example using `crypto_hash` (SHA-256 by default).

use ids_service::common::*;
use ids_service::crypto_hash::*;

fn main() {
    let mut ids = IdsService::default();
    ids.start();

    // Optional: wait until cache is 10 % full before reading
    let _ = ids.filled_at_percent_event(10).recv();

    println!("hex    : {}", ids.get_id().as_hex());
    println!("base64 : {}", ids.get_id().as_base64());
    println!(
        "cached : {}",
        ids.get_id_from_cache().expect("cache non-empty").as_hex()
    );
    println!("cache len: {}", ids.get_cache_len());

    ids.stop();
}