
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
app.softwork:kotlinx-uuid-ktor-server
Advanced tools
A multiplatform Kotlin UUID library, forked from https://github.com/cy6erGn0m/kotlinx-uuid
This is a fork from https://github.com/cy6erGn0m/kotlinx-uuid, released under Apache 2.
The main implementation was thankfully provided by cy6erGn0m!
kotlinx-uuid is a multiplatform (MPP) Kotlin library introducing support
for UUID.
The main class UUID is serializable out of the box, so the library depends
on kotlinx.serialization. If you don't need serialization, you don't
need to apply the plugin.
Supported platforms are:
To support the extensions on iOS, you need
// build.gradle.kts ios { binaries { framework { // Export transitively. transitiveExport = true } } }
This package is uploaded
to mavenCentral and to GitHub Packages.
repositories {
mavenCentral()
// or
maven {
url = uri("https://maven.pkg.github.com/hfhbd/*")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
implementation("app.softwork:kotlinx-uuid-core:LATEST")
}
val uuid = UUID("1b3e4567-e99b-13d3-a476-446657420000")
val guid = UUID("{1b3e4567-e99b-13d3-a476-446657420000}")
// using a default SecureRandom implementation
val uuid = UUID()
// use custom Kotlin Random instance
val uuid = UUID.generateUUID(yourRandom)
kotlin-uud provides the ability to generate uuids by hashing names (Only SHA-1 is supported at the moment).
val appNamespace = UUID("my-app-uuid")
val agentId = UUID.generateUUID(appNamespace, "agentId")
The other alternative is to generate UUID by hashing bytes (similar to java.util.UUID.nameUUIDFromBytes).
val uuid = UUID.generateUUID(bytes)
Note that unlike
java.util.UUID, kotlinx's generateUUID doesn't support MD5, so the blind migration from Java to kotlin-uud may lead to changing UUIDs.
There are two serializers for UUID: the default one and the binary.
The default serializer does always serialize UUIDs as string primitives.
Json.encodeToString(uuid) == "\"1b3e4567-e99b-13d3-a476-446657420000\""
The additional serializer is useful for binary formats. Because they are not human-readable, and it's possible to reduce size.
val bytes = Protobuf.encodeToByteArray(BinarySerializer, uuid)
Include uuid-ktor-server artifact:
val jvmMain by getting {
dependencies {
implementation("app.softwork:kotlinx-uuid-ktor-server:0.0.1")
}
}
Install converter:
install(DataConversion) {
uuid()
}
Unfortunately, ktor doesn't provide (KTOR-1309) any way to plug converters automatically, so you need to configure it manually. Also, in some cases, like delegating to call parameters, it will not work and there is no workaround at the moment.
Exposed is an ORM framework for Kotlin. It has support for java.util.UUID, but
to get kotlin-uuid supported you need to include the corresponding dependency and use DSL functions:
dependencies {
implementation("app.softwork:kotlinx-uuid-exposed:0.0.1")
}
When declaring a table having UUID as Primary Key:
// SQL DSL
object MyTable : KotlinxUUIDTable() {
// there is "id" property with the kotlin-uud type
}
// DAO API
class MyTableEntity(id: EntityID<UUID>) : KotlinxUUIDEntity(id) {
companion object : KotlinxUUIDEntityClass<MyTableEntity>(MyTable)
}
To declare a regular column, use kotlinxUUID function:
object MyTable : Table() {
val something = kotlinxUUID("SOME_COLUMN")
}
Unfortunately, there is a function called uuid in the base class, inside of the exposed core, this is why we can't
overwrite/override it, so it may lead to confusion. The function uuid only works with java.util.UUID:
object MyTable : Table() {
val column1 = kotlinxUUID("C1") // kotlinx.uuid.UUID
val column2 = uuid("C2") // java.util.UUID
}
FAQs
Unknown package
We found that app.softwork:kotlinx-uuid-ktor-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.