public function computeHash($publicKeyDER, $hashAlgorithm)
    {
        try {
            return (new CryptoVirgilHash($hashAlgorithm))->hash($publicKeyDER);
        } catch (Exception $exception) {
            throw new PublicKeyHashComputationException($exception->getMessage(), $exception->getCode());
        }
    }
public function computeHash($publicKeyDER, $hashAlgorithm)
    {
        try {
            return (new CryptoVirgilHash($hashAlgorithm))->hash($publicKeyDER);
        } catch (Exception $exception) {
            throw new PublicKeyHashComputationException($exception->getMessage(), $exception->getCode());
        }
    }
public function computeHash ( $ publicKeyDER , $ hashAlgorithm ) { try { return ( new CryptoVirgilHash ( $ hashAlgorithm ) ) -> hash ( $ publicKeyDER ) ; } catch ( Exception $ exception ) { throw new PublicKeyHashComputationException ( $ exception -> getMessage ( ) , $ exception -> getCode ( ) ) ; } }
Calculates key hash by the hash algorithm.

@param string  $publicKeyDER  DER public key value
@param integer $hashAlgorithm Hash algorithm

@return string

@throws PublicKeyHashComputationException
Calculates key hash by the hash algorithm .