kotlinx-uuid-datetime
Provides support for UUIDv7 using kotlinx-datetime.
dependencies {
implementation("app.softwork:kotlinx-uuid-datetime:LATEST")
}
Content copied to clipboard
UUIDv7 with the current timestamp using Clock.System
can be created using:
val uuid = UUIDv7(random = Random)
Content copied to clipboard
When processing existing UUIDv7s, the timestamp bits can be interpreted as an Instant with millisecond precision using:
UUIDv7().instant
Content copied to clipboard