Ejemplo n.º 1
0
 /**
  * Check if a (received) message has a valid HMAC
  *
  * @param  string $message
  * @param  string $hmac
  * @param  string $sharedSecret
  * @return bool
  **/
 public function validHmac($message, $hmac, $sharedSecret)
 {
     // Compare HMAC with received message
     return Hash::compare($hmac, $this->hmac($sharedSecret, $message));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  *
  * @see Hash::compare()
  */
 public function verify($string, $hash, array $options = [])
 {
     return Hash::compare($this->hash($string, $options), $hash);
 }