mhash_get_block_size()
mhash_get_block_size() — Gets the block size of the specified hash.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
The PHP manual marks this function as deprecated (since PHP 8.1): do not use it in new code.
Signature
mhash_get_block_size(int $algo): int|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $algo | int | The hash ID. One of the MHASH_hashname constants. |
Return value
Returns the size in bytes or false, if the algo does not exist.
Example
A runnable snippet:
echo mhash_get_block_size(MHASH_MD5); // 16
Changelog
| Version | Change |
|---|---|
| 8.1.0 | This function has been deprecated. Use the hash_*() functions instead. |
All PHP 8.5 built-in functions
Reference card built from the PHP manual page mhash_get_block_size() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.