PHP - 雜湊函式



函式列表

PHP − 指示支援該函式的最早 PHP 版本。

序號 函式及描述
1

hash()

hash() 函式根據演算法(如 md5、sha256)返回給定資料的雜湊值。返回值為一個包含十六進位制值的字串。

2

hash_hmac_file()

hash_hmac_file() 函式用於使用 HMAC 方法為給定檔案內容生成帶金鑰的雜湊值。

3

hash_​pbkdf2()

hash_​pbkdf2() 函式返回給定密碼的 PBKDF2 金鑰派生。

4

hash_algos()

hash_algos() 函式返回一個包含所有支援的雜湊演算法的陣列。

5

hash_copy()

hash_copy() 函式用於複製從 hash_init() 生成的雜湊上下文。

6

hash_equals()

hash_equals() 函式同時比較兩個給定的字串,如果相等則返回 true。

7

hash_file()

hash_file() 函式將返回給定檔案內容的雜湊值。返回值將是一個小寫十六進位制值的字串。

8

hash_final()

hash_final() 函式返回最終的訊息摘要。

9

hash_hkdf()

hash_hkdf() 函式返回給定輸入金鑰的 HKDF 金鑰派生。

10

hash_hmac()

hash_hmac() 函式用於使用 HMAC 方法生成帶金鑰的雜湊值。

11

hash_hmac_algos()

hash_hmac_algos() 函式返回一個包含所有適合於 hash_hmac 的雜湊演算法的陣列。

12

hash_init()

hash_init() 函式初始化一個增量雜湊上下文,可與其他雜湊函式(如 hash_update()、hash_final() 等)一起使用。

13

hash_update()

hash_update() 函式將使用雜湊上下文更新給定的資料。

14

hash_update_file()

hash_update_file() 函式將使用雜湊上下文更新給定的檔案內容。

15

hash_update_stream()

hash_update_stream() 函式將從開啟的流更新雜湊上下文。

php_function_reference.htm
廣告