예제 #1
0
파일: HashGenerator.php 프로젝트: blar/hash
 /**
  * @return Hash
  */
 public function getHash() : Hash
 {
     $hash = new Hash();
     $hash->setAlgorithm($this->getAlgorithm());
     $hash->setValue(hash_final(hash_copy($this->getHandle()), true));
     return $hash;
 }
예제 #2
0
파일: OpenSSL.php 프로젝트: blar/openssl
 /**
  * @param string $data
  * @param string $algorithm
  *
  * @return Hash
  */
 public static function digest(string $data, string $algorithm) : Hash
 {
     $hash = new Hash();
     $hash->setAlgorithm($algorithm);
     $hash->setValue(openssl_digest($data, $algorithm, TRUE));
     return $hash;
 }