hash_update()

hash_update() — Pump data into an active hashing context.

Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL hash >= 1.1. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

Signature

hash_update(HashContext $context, string $data): true

Parameters

ParameterTypeWhat it takes
$contextHashContextHashing context returned by hash_init().
$datastringMessage to be included in the hash digest.

Return value

Always returns true.

Example

The PHP manual ships no example for hash_update(); the signature and the parameter table above are the contract.

Changelog

VersionChange
8.4.0Now has a return type of true instead of bool.
7.2.0Accept HashContext instead of resource.

See also

hash_init(), hash_update_file(), hash_update_stream(), hash_final()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page hash_update() (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.