You are here

public static function AcquiaSearchSolrCrypt::randomBytes in Acquia Connector 7.3

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 AcquiaSearchSolrCrypt::randomBytes()
AcquiaSearchSolrApi::getIndexes in acquia_search/includes/AcquiaSearchSolrApi.php
Returns list of search indexes.
AcquiaSearchSolrService::makeServletRequest in acquia_search/includes/AcquiaSearchSolrService.php
Make a request to a servlet (a path) that's not a standard path.
AcquiaSearchSolrService::_sendRawGet in acquia_search/includes/AcquiaSearchSolrService.php
Central method for making a GET operation against this Solr Server
AcquiaSearchSolrService::_sendRawPost in acquia_search/includes/AcquiaSearchSolrService.php
Central method for making a POST operation against this Solr Server

File

acquia_search/includes/AcquiaSearchSolrCrypt.php, line 17

Class

AcquiaSearchSolrCrypt
Class AcquiaSearchSolrCrypt.

Code

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