Public Functions
 FunctionDefined by
  
generateRandomBytes(numberRandomBytes:uint):ByteArray
Generates a sequence of random bytes.
flash.crypto
Function detail
generateRandomBytes()function
public function generateRandomBytes(numberRandomBytes:uint):ByteArray

Language version: ActionScript 3.0
Runtime version: AIR 3

Generates a sequence of random bytes.

Use generateRandomBytes() to generate cryptographic keys, strong identifiers, session ids, and so on. The random sequence is generated using cryptographically strong functions provided by the operating system. If the appropriate function is not available on an individual client computer or device, then an error is thrown.

Parameters
numberRandomBytes:uint — the number random bytes to generate, between 1 and 1024.

Returns
ByteArray — a ByteArray containing the generated bytes.

Throws
Error — when the random bytes could not be generated.

See also