Returns a URL-safe, base64 encoded string of highly randomized bytes (over the full 8-bit range).
$byte_count: The number of random bytes to fetch and base64 encode.
string The base64 encoded result will have a length of up to 4 * $byte_count.
function drupal_random_key($byte_count = 32) {
return drupal_base64_encode(drupal_random_bytes($byte_count));
}