Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

As of Drupal 8 cryptographic related functionality has been moved to a new Crypt component.

Removed functions:

  • drupal_random_bytes()
  • drupal_hmac_base64()
  • drupal_hash_base64()

D7

$key = drupal_hash_base64($data);
$key = drupal_hmac_base64($data, $key);
$key = drupal_random_bytes(55);

D8

use Drupal\Component\Utility\Crypt;

$key = Crypt::hashBase64($data);
$key = Crypt::hmacBase64($data, $key);
$key = Crypt::randomBytes(55);
// Returns a URL-safe, base64 encoded string of highly randomized bytes.
$cron_key = Crypt::randomBytesBase64(55);
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done