K/N doesn't have a UUID yet. This brings a UUID that matches UUIDs on various platforms:
- iOS/Mac:
NSUUID
- Java:
java.util.UUID
- Frozen
- Thread-safe (thread-safe randomness in native)
- Adheres to RFC4122
- Tested
- Tested against macOS/iOS UUID to verify correctness
In your build.gradle(.kts):
- Add
mavenCentral()
to your repositories - Add
implementation "com.benasher44:uuid:<version>"
as a dependency in yourcommonMain
sourceSets
.
This library publishes gradle module metadata. If you're using Gradle prior to version 6, you should have enableFeaturePreview("GRADLE_METADATA")
in your settings.gradle(.kts).
- Develop UUID functionality that can be contributed back to the Kotlin stdlib (see latest issues, PRs, and CHANGELOG.md for updates)