Expand description
Example
use shortid::*;
fn to_string(src:&[u8])->String {
src
.into_iter()
.map(|val| format!("{:0>2x}", val))
.collect()
}
fn main() {
let mac = [1,2,3,4,5,6];
let epoch = 0;
println!("{}" , to_string(&uuidv1(mac).unwrap()));
let mac = [1,2,3,4];
println!("{}" , to_string(&next_short_128(mac).unwrap()));
let mac = [1,2,3];
println!("{}" , to_string(&next_short_96(mac,epoch).unwrap()));
println!("{}" , to_string(&next_short_64(epoch).unwrap()));
}
Enums§
Functions§
- next_
short_ 64 - for standalone
- next_
short_ 96 - for network
- next_
short_ 128 - for compatible UUID
- next_
short_ 128_ sync - uuidv1 generator
- short_
64_ to_ 96 - short_
64_ to_ 128 - short_
96_ to_ 128 - uuidv1
- uuidv1 generator