(PHP 5 >= 5.1.2, PHP 7, PECL hash >= 1.1)
hash_hmac_file — ʹ�� HMAC ���������ļ����������ɴ���Կ�Ĺ�ϣֵ
$algo
, string $filename
, string $key
[, bool $raw_output = FALSE
] ) : string
algoҪʹ�õĹ�ϣ�㷨���ƣ����磺"md5"��"sha256"��"haval160,4" �ȡ� ��λ�ȡ��֧�ֵ��㷨�嵥����μ� hash_hmac_algos() ������
filenameҪ���й�ϣ������ļ�·����֧�� fopen ��װ����
keyʹ�� HMAC ������ϢժҪʱ��ʹ�õ���Կ��
raw_output
����Ϊ TRUE ���ԭʼ���������ݣ�
����Ϊ FALSE ���Сд 16 �����ַ�����
��� raw_output ����Ϊ TRUE�� ��ԭʼ���������ݱ�ʾ����ϢժҪ��
���� 16 ����Сд�ַ�����ʽ��ʾ����ϢժҪ��
��� algo ����ָ���IJ�����֧�ֵ��㷨����������ȡ filename �������ļ����� FALSE��
| �汾 | ˵�� |
|---|---|
| 7.2.0 | ����֧�ַǼ��ܵĹ�ϣ������adler32��crc32��crc32b��fnv132��fnv1a32��fnv164��fnv1a64��joaat���� |
Example #1 hash_hmac_file() ����
<?php
/* ����һ��Ҫ�����ϣֵ���ļ� */
file_put_contents('example.txt', 'The quick brown fox jumped over the lazy dog.');
echo hash_hmac_file('md5', 'example.txt', 'secret');
?>
�������̻������
7eb2b5c37443418fc77c136dd20e859c