Home >Backend Development >PHP Tutorial >Detailed explanation of the difference between php md5 and md5_file_PHP tutorial

Detailed explanation of the difference between php md5 and md5_file_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 10:54:091376browse

md5($str) Hash encryption for string

Examples
*/
$str="hello world"; //Define string
$result=md5($str); //Perform encryption operation
echo $result; //Output the converted result

//md5_file( $filepath) Hash-encrypts the file content

$file="test.txt"; //Definition file
$result=md5_file($file); //Perform calculation operation
echo $result; //Output the calculated result

/*

The md5_file() function calculates the md5 hash of a file.

The md5() function uses rsa data security, including the md5 message digest algorithm.

Returns the calculated md5 hash if successful, false if failed.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632347.htmlTechArticlemd5($str) Hash encryption example for string*/ $str=hello world;//Definition String $result=md5($str);//Perform encryption operation echo $result;//Output the converted result//md5_file( $fi...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn