klyn.cryptography.SecureRandom.nextHex
method
public nextHex(sizeBytes as Int) as String throws CryptoException:
Description

Generates random data encoded as hexadecimal.

Parameters
ParameterDescription
sizeBytesNumber of random bytes to generate.
Returns

Lower-case hexadecimal text.

Throws
  • CryptoException when generation fails.
Example
import klyn.cryptography

random = SecureRandom()
print(random.nextHex(16))