1.20.x bootstrap.inc backdrop_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.

File

includes/bootstrap.inc, line 2772
Functions that need to be loaded on every Backdrop request.

Code

function backdrop_random_key($byte_count = 32) {
  return backdrop_base64_encode(backdrop_random_bytes($byte_count));
}