Skip to content

Random

Include: Use System\Security.pkg

See Also: DFSEC_Random

Purpose

Generates random bytes or readable random text into a caller-provided destination.

Constants

C_DFSEC_RANDOM_ENGINE_DEFAULT : Fills the destination with raw pseudo-random bytes.

C_DFSEC_RANDOM_ENGINE_ASCII : Fills the destination with readable characters from A-Z, a-z, 0-9, @, #, and _.

DFSEC_RANDOM_ENGINE : Integer-backed DataFlex engine type used by DFSEC_Random.

Behavior

Use DFSEC_Random to fill a UChar[], String, or WString destination. Use the ASCII engine when the result must be readable text.

No security-strength guarantee is documented here.

Example

UChar[] ucaBytes
String sText

Send DFSEC_Random (&ucaBytes) 32
Send DFSEC_Random (&sText) 32 C_DFSEC_RANDOM_ENGINE_ASCII