[][src]Crate ids_service

Library that allows to generate unique Ids. The utility caches the ids and when the cache reaches a lower limit then a fill thread is enabled. If the cache is empty (the number of requests is too high) an id is calculated on the fly. This will slow down obtaining the id but there is no error if the cache is empty. To generate unique ids the library uses a random number generator and a SHA256 hash for the id as String type. For type u128 it is the value of the random number generator used as id

Quick Start

extern crate ids_service;
use ids_service::ids::*;

let mut z: IdsService<String> = IdsService::new( ConfigIdsService::default());
println!("Get an id as String using SHA256 hash:"); z.get_id();

// Use iterator
for z in z.iter() {
    println!("Read id: {}",z);
}

The lib use simplelog see for configuration: crates.io Rust Package Registry SimpleLog .

Modules

ids

Module ids with all implementation