openssl_digest
Function • Params and return types changed in PHP 8.0
Computes a digest.
openssl_digest Function synopsis
openssl_digest(
string $data,
string $digest_algo,
bool $binary = false
): string|false
Parameters
$data
Typestring
The data.
$digest_algo
Typestring
The digest method to use, e.g. "sha256", see openssl_get_md_methods for a list of available digest methods.
$binary
OptionalTypeboolDefault valuefalse
Setting to true will return as raw output data, otherwise the return
value is binhex encoded.
Return value
Typestring|false
Returns the digested hash value on success or false on failure.
Changes to the openssl_digest Function
PHP 8.0
- Return type added:
string|false - Parameter type added for parameter #1 (
$data):string - Parameter name of parameter #2 changed:
$methodto$digest_algo - Parameter type added for parameter #2 (
$digest_algo):string - Parameter name of parameter #3 changed:
$raw_outputto$binary - Parameter type added for parameter #3 (
$binary):bool - Parameter default value added for position #3 (
$binary):false
openssl_digest(
- $data,
+ string $data,
- $method,
+ string $digest_algo,
- $raw_output
+ bool $binary = false
- )
+ ): string|false openssl_digest Function Availability
openssl_digest Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |