hash_copy
hash_copy
(PHP 5 >= 5.3.0, PHP 7)
hash_copy — 复制散列上下文
描述
resource hash_copy ( resource $context )
参数
context
由hash_init()返回的散列上下文。
返回值
返回哈希上下文资源的副本。
例子
示例#1 hash_copy()示例
<?php
$context = hash_init("md5"
hash_update($context, "data"
/* copy context to be able to continue using it */
$copy_context = hash_copy($context
echo hash_final($context), "\n";
hash_update($copy_context, "data"
echo hash_final($copy_context), "\n";
?>
上面的例子将输出:
8d777f385d3dfec8815d20f7496026dc
511ae0b1c13f95e5f08f1a0dd3da3d93