Skip to main content

basic/
basic.rs

1use evil_id::EvilId;
2
3fn main() {
4    let id: EvilId = EvilId::generate(); // A new id can be created with the generate function.
5
6    let id_string: String = id.get(); // The stringify function creates a 16 character string representing the id.
7
8    let also_id: EvilId = EvilId::new_from(id_string.clone()).expect("Shouldn't happen."); // We can get the id back from a String. MAke sure to give it a valid id string or it will throw an error.
9
10    let is_eq = id == also_id; // They should be the same.
11
12    println!("ID: {id_string}\nIs eq: {is_eq}");
13}