hash_update()


bool hash_update(string $context , string $data)

Description

The hash_update() pumps data into an active hashing context

※ available F/W version : all

Parameters

Return values

Returns TRUE.

Example

<?php
$data1 = "abcdefg";
$data2 = "hijklmn";

$context = hash_init("md5");
hash_update($context, $data1);
hash_update($context, $data2);
$hash_value = hash_final($context, true);

hexdump($hash_value);
// OUTPUT: 0000  08 45 a5 97 2c d9 ad 4a  46 ba d6 6f 12 53 58 1f  |.E..,..JF..o.SX.|
?>

See also

hash() / hash_init() / hash_final() / hash_hmac()

Remarks

hash_update() is identical to PHP group’s hash_update function.