You are here

public static function SearchApiAcquiaCrypt::randomBytes in Acquia Search for Search API 7.2

Generates random bytes.

Parameters

int $count: The number of characters (bytes) to return in the string.

Return value

string String of random bytes.

4 calls to SearchApiAcquiaCrypt::randomBytes()
SearchApiAcquiaApi::getIndexes in includes/v3/SearchApiAcquiaApi.php
Returns list of search indexes.
SearchApiAcquiaSearchConnectionV3::makeServletRequest in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Makes a request to a servlet (a path) that's not a standard path.
SearchApiAcquiaSearchConnectionV3::sendRawGet in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Sends a GET request to the Solr server.
SearchApiAcquiaSearchConnectionV3::sendRawPost in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Sends a PUT request to the Solr server.

File

includes/v3/SearchApiAcquiaCrypt.php, line 17

Class

SearchApiAcquiaCrypt
Class SearchApiAcquiaCrypt.

Code

public static function randomBytes($count) {
  $random_bytes = drupal_random_bytes($count);
  $nonce = str_replace([
    '+',
    '/',
    '=',
  ], [
    '-',
    '_',
    '',
  ], base64_encode($random_bytes));
  return $nonce;
}