Skip to main content

ulid

Function ulid 

Source
pub fn ulid() -> Ulid
Expand description

Generates a ULID, a 26-character ID that holds the system time in milliseconds followed by random bits.

IDs sort by the millisecond they were created in, and IDs from the same millisecond sort in random order.

let id = laravel::str::ulid();

assert_eq!(id.to_string().len(), 26);

§Panics

Panics when the operating system can’t provide random bytes.