= 5.1.2, PHP 7, PHP 8, PECL hash >= 1.1)hash_update_file — 從文件向活躍的哈希運(yùn)算上下文中填充數(shù)據(jù)說明hash_update_file(HashContext $hcontext, string">

hash_update_file

(PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL hash >= 1.1)

hash_update_file從文件向活躍的哈希運(yùn)算上下文中填充數(shù)據(jù)

說明

hash_update_file(HashContext $hcontext, string $filename, resource $scontext = null): bool

參數(shù)

hcontext

hash_init() 函數(shù)返回的哈希運(yùn)算上下文。

filename

要進(jìn)行哈希運(yùn)算的文件路徑,支持 fopen 封裝器。

scontext

stream_context_create() 函數(shù)返回的流上下文。

返回值

成功時返回 true, 或者在失敗時返回 false

更新日志

版本 說明
7.2.0 接收參數(shù)從資源類型修改為 HashContext 對象類型。

參見

  • hash_init() - 初始化增量哈希運(yùn)算上下文
  • hash_update() - 向活躍的哈希運(yùn)算上下文中填充數(shù)據(jù)
  • hash_update_stream() - 從打開的流向活躍的哈希運(yùn)算上下文中填充數(shù)據(jù)
  • hash_final() - 結(jié)束增量哈希,并且返回摘要結(jié)果
  • hash() - 生成哈希值 (消息摘要)
  • hash_file() - 給指定文件的內(nèi)容生成哈希值