use std::time::{Duration, SystemTime};

pub(crate) fn new_ulid() -> ulid::Ulid {
    let timestamp_ms = SystemTime::now()
        .duration_since(SystemTime::UNIX_EPOCH)
        .unwrap_or(Duration::ZERO)
        .as_millis() as u64;

    ulid::Ulid::from_parts(timestamp_ms, rand::random::<u128>())
}
