Skip to content
/ kt-uuid Public

Pure Kotlin Multiplatform implementation of UUIDv4

License

Notifications You must be signed in to change notification settings

vooft/kt-uuid

Repository files navigation

Build and test Releases Maven Central License

kt-uuid

Simple Kotlin Multiplatform library to generate UUIDs.

Supported platforms

Library has only one critical dependency - secure-random, adding new platforms is mostly limited by which platforms does this library support.

Currently it is compiled for:

  • jvm
  • macosArm64
  • macosX64
  • iosArm64
  • iosSimulatorArm64
  • iosX64
  • js (browser/nodejs)
  • wasm (browser/nodejs)
  • mingwX64
  • linuxX64

Quick start

Library is published to Maven Central under name io.github.vooft:kt-uuid-core.

Add the dependency to your project:

kotlin {
    ...

    sourceSets {
        commonMain.dependencies {
            implementation("io.github.vooft:kt-uuid-core:<version>")
        }
    }
}

API is trying to mirror the java.util.UUID class as much as possible.

import io.github.vooft.kuuid.UUID

val uuid1 = UUID.randomUUID()
val uuid2 = UUID.fromString("123e4567-e89b-12d3-a456-426614174000")

println(uuid1.toString())
println(uuid2.toString()) // prints "123e4567-e89b-12d3-a456-426614174000"

About

Pure Kotlin Multiplatform implementation of UUIDv4

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages