PHP8 hash_update_file

2024-03-01 09:28 更新

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

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

說明

hash_update_file(HashContext $context, string $filename, ?resource $stream_context = null): bool

參數(shù) 

context

由 hash_init() 函數(shù)返回的散列運(yùn)算上下文。

filename

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

stream_context

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

返回值 

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。

更新日志 

版本說明
8.0.0stream_context 現(xiàn)在可以為 null。
7.2.0接收參數(shù)從資源類型修改為 HashContext 對(duì)象類型。

參見 

  • 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)容生成散列值


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)