Std.Uuid.version7
1 declaration
fn
version7: &Std.Random.Generator -> Int -> (Std.Random.Generator, Std.Uuid.Uuid)This is a callable function.
What it does
An identifier that sorts by when it was made.
The first six bytes are the millisecond the clock read, most significant
first, so identifiers made in order compare in order. That is what a
database index wants: a random identifier scatters writes across the whole
index, while one that increases appends to the end of it.
The remaining bytes are random, so two identifiers made in the same
millisecond are still distinct.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- & borrows a value for this call instead of moving or copying it.
