klyn.cryptography.SecureRandom.nextHex
method
public nextHex(sizeBytes as Int) as String throws CryptoException:
Description
Generates random data encoded as hexadecimal.
import klyn.cryptography

random = SecureRandom()
print(random.nextHex(16))
Parameters
  • sizeBytes Number of random bytes to generate.
Returns
Lower-case hexadecimal text.
Throws
  • CryptoException when generation fails. ```klyn import klyn.cryptography random = SecureRandom() print(random.nextHex(16)) ```