Home >Backend Development >PHP Problem >What does md5 mean in php

What does md5 mean in php

(*-*)浩
(*-*)浩Original
2019-09-05 13:53:173688browse

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!

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