All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.relaycorp.relaynet.wrappers.PRNG.kt Maven / Gradle / Ivy

There is a newer version: 1.69.11
Show newest version
package tech.relaycorp.relaynet.wrappers

import java.math.BigInteger
import java.security.SecureRandom

internal fun generateRandomBigInteger(): BigInteger {
    val random = SecureRandom()
    return BigInteger(64, random)
}

internal fun generateRandomOctets(size: Int): ByteArray {
    val random = SecureRandom()
    val bytes = ByteArray(size)
    random.nextBytes(bytes)
    return bytes
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy