You are here

public function UserEmailVerification::buildHmac in User email verification 8

Build a base-64 encoded sha-256 HMAC.

Parameters

int $uid: User ID.

int $timestamp: Timestamp value.

Return value

string A base-64 encoded sha-256 hmac.

Overrides UserEmailVerificationInterface::buildHmac

2 calls to UserEmailVerification::buildHmac()
UserEmailVerification::buildExtendedVerificationUrl in src/UserEmailVerification.php
Build extended Email verification URL for requested user.
UserEmailVerification::buildVerificationUrl in src/UserEmailVerification.php
Build Email verification URL for requested user.

File

src/UserEmailVerification.php, line 213

Class

UserEmailVerification
User email verification helper service.

Namespace

Drupal\user_email_verification

Code

public function buildHmac($uid, $timestamp) {
  return Crypt::hmacBase64($timestamp . $uid, Settings::getHashSalt() . $uid);
}