You are here

class SearchApiAcquiaCrypt in Acquia Search for Search API 7.2

Class SearchApiAcquiaCrypt.

Hierarchy

Expanded class hierarchy of SearchApiAcquiaCrypt

File

includes/v3/SearchApiAcquiaCrypt.php, line 6

View source
class SearchApiAcquiaCrypt {

  /**
   * Generates random bytes.
   *
   * @param int $count
   *   The number of characters (bytes) to return in the string.
   *
   * @return string
   *   String of random bytes.
   */
  public static function randomBytes($count) {
    $random_bytes = drupal_random_bytes($count);
    $nonce = str_replace([
      '+',
      '/',
      '=',
    ], [
      '-',
      '_',
      '',
    ], base64_encode($random_bytes));
    return $nonce;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SearchApiAcquiaCrypt::randomBytes public static function Generates random bytes.