feat(serial):基本完成UUID和Short UUID的生成功能。

This commit is contained in:
徐涛
2023-06-30 16:32:00 +08:00
parent 260f17021b
commit 039596a4f5
3 changed files with 64 additions and 1 deletions

20
tests/serial_codes.rs Normal file
View File

@@ -0,0 +1,20 @@
#[cfg(test)]
mod uuid_test {
#[test]
fn gen_uuid() {
let uuid = rs_toolbox::serial_code::uuid::new();
println!("{}", uuid);
}
}
#[cfg(test)]
mod short_uuid_test {
#[test]
fn gen_short() {
let short_uuid = rs_toolbox::serial_code::short_uuid::new(10);
println!("{}", short_uuid);
if short_uuid.len() != 10 {
panic!("short_uuid length is not enough");
}
}
}