use uuid::Uuid;
pub struct GeneratorId;
impl GeneratorId {
pub fn uuid_v4() -> String {
Uuid::new_v4().as_simple().to_string()
}
pub fn uuid_v4_12() -> String {
let uuid = Uuid::new_v4().to_string().replace("-","");
uuid[0..12].to_string()
}
pub fn snowflake_id() -> i64 {
snowflake::SnowflakeIdBucket::new(1,1).get_id()
}
}