"PHP hash hmac()"의 두 판 사이의 차이

 
(사용자 2명의 중간 판 4개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;hash_hmac()
{{DISPLAYTITLE:PHP hash_hmac()}}
;PHP hash_hmac()


<source lang='php'>
<syntaxhighlight lang='php' run>
echo hash_hmac('ripemd160', 'The quick brown fox jumped over the lazy dog.', 'secret');
echo hash_hmac('ripemd160', 'The quick brown fox jumped over the lazy dog.', 'secret'); # b8e7ae12510bdfb1812e463a7f086122cf37e4f7
# b8e7ae12510bdfb1812e463a7f086122cf37e4f7
</syntaxhighlight>
</source>
<syntaxhighlight lang='php' run>
<source lang='php'>
echo hash_hmac( 'sha1', 'hello world', 'secret' ); # 03376ee7ad7bbfceee98660439a4d8b125122a5a
echo hash_hmac( 'sha1', 'hello world', 'secret' );
</syntaxhighlight>
# 03376ee7ad7bbfceee98660439a4d8b125122a5a
<syntaxhighlight lang='php' run>
</source>
<source lang='php'>
$h = hash_hmac( 'sha1', 'hello world', 'secret', true );
$h = hash_hmac( 'sha1', 'hello world', 'secret', true );
echo base64_encode( $h );
echo base64_encode( $h ); # Azdu5617v87umGYEOaTYsSUSKlo=
# Azdu5617v87umGYEOaTYsSUSKlo=
</syntaxhighlight>
</source>


==같이 보기==
==같이 보기==
*[[PHP hash()]]
* [[PHP hash()]]
*[[PHP hash_algos()]]
* [[PHP hash_algos()]]
*[[PHP hash_init()]]
* [[PHP hash_init()]]
*[[PHP hash_hmac_file()]]
* [[PHP hash_hmac_file()]]
*[[함수 hash_hmac()]]
* [[PHP unserialize()]]
*[[HMAC]]
* [[함수 hash_hmac()]]
* [[HMAC]]


==참고 자료==
==참고==
* http://php.net/manual/en/function.hash-hmac.php
* http://php.net/manual/en/function.hash-hmac.php


[[분류: PHP]]
[[분류: PHP]]

2021년 5월 14일 (금) 17:55 기준 최신판

1 개요[ | ]

PHP hash_hmac()
echo hash_hmac('ripemd160', 'The quick brown fox jumped over the lazy dog.', 'secret'); # b8e7ae12510bdfb1812e463a7f086122cf37e4f7
echo hash_hmac( 'sha1', 'hello world', 'secret' ); # 03376ee7ad7bbfceee98660439a4d8b125122a5a
$h = hash_hmac( 'sha1', 'hello world', 'secret', true );
echo base64_encode( $h ); # Azdu5617v87umGYEOaTYsSUSKlo=

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}