You are here

public function EmailConfirmation::getHash in Email confirmer 8

Calculate hash for this email confirmation.

Return value

string The hash.

Overrides EmailConfirmationInterface::getHash

1 call to EmailConfirmation::getHash()
EmailConfirmation::confirm in src/Entity/EmailConfirmation.php
Process the email confirmation.

File

src/Entity/EmailConfirmation.php, line 310

Class

EmailConfirmation
Defines the email confirmation entity class.

Namespace

Drupal\email_confirmer\Entity

Code

public function getHash() {
  $data = $this
    ->getEmail() . $this
    ->getCreatedTime() . $this
    ->getIp() ?: '';
  return Crypt::hmacBase64($data, \Drupal::service('private_key')
    ->get());
}