超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<md5_filemetaphone>
Last updated: Fri, 22 Jun 2007

md5

(PHP 3, PHP 4 , PHP 5)

md5 -- Calculate the md5 hash of a string

Description

string md5 ( string str [, bool raw_output])

Calculates the MD5 hash of str using the RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash. The hash is a 32-character hexadecimal number. If the optional raw_output is set to TRUE, then the md5 digest is instead returned in raw binary format with a length of 16.

注: The optional raw_output parameter was added in PHP 5.0.0 and defaults to FALSE

例子 1. A md5() example

<?php
$str
= 'apple';

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

See also crc32(), md5_file(), and sha1().




add a note add a note User Contributed Notes
md5
jure at kiss dot uni-lj dot si
25-Mar-2001 02:28
For those searching for a md5 crypt function
that would return a md5 password hash compatible
with freebsd's password files (or most modern
unix password files), i rewrote the md5crypt python module
in php. It is available from http://limonez.net/~jure/php/
It seems to be very slow, though, and I haven't had much time to optimize it (yet).

<md5_filemetaphone>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22