\CryptoManana\Core\Traits\MessageDigestionSecureVerificationTrait

Trait SecureVerificationTrait - Reusable implementation of `SecureVerificationInterface`.

Summary

Methods
Properties
Constants
hashData()
verifyHash()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

hashData()

hashData(string  $data) : string

Calculates a hash value for the given data.

Parameters

string $data

The input string.

Throws

\Exception

Validation errors.

Returns

string —

The digest.

verifyHash()

verifyHash(string  $data, string  $digest) : boolean

Securely compares and verifies if a digestion value is for the given input data.

Parameters

string $data

The input string.

string $digest

The digest string.

Throws

\Exception

Validation errors.

Returns

boolean —

The result of the secure comparison.