Function __global->random_bytes

Definitions

sources_custom/phpstub.php

  • Generates cryptographically secure pseudo-random bytes.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$length integer No No required parameter N/A N/A The length of the random string that should be returned in bytes

Returns

  • A string containing the requested number of cryptographically secure random bytes
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Generates cryptographically secure pseudo-random bytes.
 *
 * @param  integer $length The length of the random string that should be returned in bytes
 * @return string A string containing the requested number of cryptographically secure random bytes
 */

function random_bytes(int $length) : string