klyn.cryptography.SecureRandom.nextUrlBase64
method
public nextUrlBase64(sizeBytes as Int) as String throws CryptoException:
Description
Generates random data encoded as URL-safe Base64.
import klyn.cryptography

random = SecureRandom()
print(random.nextUrlBase64(16))
Parameters
  • sizeBytes Number of random bytes to generate.
Returns
URL-safe Base64 text.
Throws
  • CryptoException when generation fails. ```klyn import klyn.cryptography random = SecureRandom() print(random.nextUrlBase64(16)) ```