function drupal_random_key

7.x bootstrap.inc drupal_random_key($byte_count = 32)
6.x bootstrap.inc drupal_random_key($byte_count = 32)

Returns a URL-safe, base64 encoded string of highly randomized bytes (over the full 8-bit range).

Parameters

$byte_count: The number of random bytes to fetch and base64 encode.

Return value

string The base64 encoded result will have a length of up to 4 * $byte_count.

3 calls to drupal_random_key()
drupal_get_form in drupal-6.x/includes/form.inc
Retrieves a form from a constructor function, or from the cache if the form was built in a previous page-load. The form is then passed on for processing, after and rendered for display if necessary.
drupal_get_private_key in drupal-6.x/includes/common.inc
Ensure the private key variable used to generate tokens is set.
drupal_rebuild_form in drupal-6.x/includes/form.inc
Retrieves a form, caches it and processes it with an empty $_POST.

File

drupal-6.x/includes/bootstrap.inc, line 1347
Functions that need to be loaded on every Drupal request.

Code

function drupal_random_key($byte_count = 32) {
  return drupal_base64_encode(drupal_random_bytes($byte_count));
}