public class SecureRandom extends Object
Transport-safe secure random helper.
Uses the operating system's cryptographically secure random generator (CNG on Windows, getrandom on Linux), without loading an OpenSSL provider. The public API exposes hexadecimal and Base64 text encodings; it does not expose a raw Byte[] generation method.
import klyn.cryptography random = SecureRandom() print(random.nextHex(16))
| Modifier and Type | Member | Description |
|---|---|---|
| public | SecureRandom | Creates a secure random generator instance. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | nextBase64nextBase64(sizeBytes as Int) as String throws CryptoException |
Generates random data encoded as standard Base64. |
| public | nextHexnextHex(sizeBytes as Int) as String throws CryptoException |
Generates random data encoded as hexadecimal. |
| public | nextUrlBase64nextUrlBase64(sizeBytes as Int) as String throws CryptoException |
Generates random data encoded as URL-safe Base64. |