📖 Simple Uuid serializer library
KotlinDSL:
repositories {
maven {
name = "lepinoid"
url = uri("https://lepinoid.github.io/maven-repo/")
}
}
dependencies {
implementation("net.lepinoid:uuid-serializer-jvm:$VERSION")
}
commonMain {
dependencies {
implementation("net.lepinoid:uuid-serializer:$VERSION")
}
}
@Serializable
class SomeClass(
@Serializable(with = UuidSerialzier::class)
val uuid: Uuid
)
fun main() {
val uuid = uuid4()
val json = Json.encodeToString(UuidSerializer, uuid)
val decoded = Json.decodeFromString<Uuid>(UuidSerializer, json)
}