Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 399 Bytes

README.md

File metadata and controls

17 lines (14 loc) · 399 Bytes

Module 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())
}