Home >Backend Development >PHP Problem >What does md5 mean in php
PHP md5() function
Definition and usage (recommended learning: PHP video tutorial)
md5() function calculates the MD5 hash of a string.
The md5() function uses RSA data security, including the MD5 message digest algorithm.
Explanation from RFC 1321 - MD5 message digest algorithm: The MD5 message digest algorithm takes information of any length as an input value and converts it into a 128-bit length "fingerprint information" or The "message digest" value represents this input value, and the converted value is used as the result.
MD5 algorithm is mainly designed for digital signature applications; in this digital signature application, larger files will be encrypted (the encryption process here is by encrypting a password Compressed in a secure manner before setting the private key under the public key of the system [e.g.: RSA].
To calculate the MD5 hash of a file, use the md5_file() function.
Syntax
md5(string,raw)<br/>
string, required. Specifies the string to be calculated.
raw, optional. Specifies the hexadecimal or binary output format:
TRUE - raw 16-character binary format
FALSE - default. 32 character hexadecimal number
Return value:Returns the calculated MD5 hash on success, or FALSE on failure.
Compute the MD5 hash of the string "Hello":<!DOCTYPE html><br/><html><br/><body><br/><br/><?php<br/>$str = "Shanghai";<br/>echo md5($str);<br/>?> <br/> <br/></body><br/></html><br/>
The above is the detailed content of What does md5 mean in php. For more information, please follow other related articles on the PHP Chinese website!