Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 419 Bytes

README.md

File metadata and controls

19 lines (16 loc) · 419 Bytes

Module crypto-rand

Obtain cryptographically secure random bytes from system sources.

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

    println(bytes.toList())
    // 
}