nextBytes

abstract fun nextBytes(buf: ByteArray): ByteArray(source)

Fills the provided buf array with securely generated random data, procured from system sources. If the underlying system has not collected enough entropy yet, this function may block.

NOTE: buf is modified in place, whereby any RandomnessProcurementException thrown may leave buf partially filled. It must be discarded in that event.

Return

buf

Parameters

buf

the array to fill

Throws

if the underlying API fails