crypto-rand

Procure cryptographically secure random data from system sources.

fun main() {
val bytes = try {
CryptoRand.Default.nextBytes(ByteArray(16))
} catch (e: RandomnessProcurementException) {
// Underlying platform API failed to procure data from system sources.
e.printStackTrace()
return
}

println(bytes.toList())
}

Packages

Link copied to clipboard
common