简体   繁体   English

在PHP中继续SHA1哈希

[英]Continuing a SHA1 hash in PHP

Is it possible to "continue" a hash in PHP? 是否可以在PHP中“继续”哈希? Say for example I start hashing a large chuck of data like this: 举例来说,我开始像这样散列大量数据:

$ctx = hash_init('sha1');
hash_update($ctx, $data_block);
$hash = hash_final($ctx);

That's all well and good but suppose the data is not fully available at that point and I want to "pause" the hashing mid-way and save where we're up to and then finish processing later. 一切都很好,但是假设那时数据还不完全可用,我想中途“暂停”哈希并保存我们要处理的内容,然后在以后完成处理。 Is this possible? 这可能吗?

Thanks, J 谢谢,J

Not really, no. 不是,不是 Why not just wait to call hash_final until you've received all the data? 为什么不等到收到所有数据hash_final等待调用hash_final

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM