Forum und email

md5

(PHP 4, PHP 5, PECL hash:1.1-1.3)

md5 — 문자열의 md5 해쉬를 계산합니다.

설명

string md5 ( string $str [, bool $raw_output ] )

» RSA Data Security, Inc. MD5 Message-Digest Algorithm을 사용하여 str 의 MD5 해쉬를 계산하여 반환합니다. 해쉬는 16진수의 32문자입니다. 선택적인 raw_outputTRUE로 설정하면, md5 다이제스트는 16의 길이를 가지는 순수 바이너리 형식으로 반환합니다.

Note: 선택적인 raw_output 인자는 PHP 5.0.0에서 추가되었고, 기본값으로 FALSE입니다.

Example#1 md5() 예제

<?php
$str 
'apple';

if (
md5($str) === '1f3870be274f6c49b3e31a0c6728957f') {
    echo 
"Would you like a green or red apple?";
    exit;
}
?>

참고: crc32(), md5_file(), sha1().