commonMain.dev.fritz2.core.id.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-jvm Show documentation
Show all versions of core-jvm Show documentation
Easily build reactive web-apps in Kotlin based on flows and coroutines
package dev.fritz2.core
object Id {
private const val defaultLength = 6
private val chars = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ".toCharArray()
fun next(length: Int = defaultLength) = buildString {
for (i in 0 until length) {
append(chars.random())
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy