Home  >  Article  >  Backend Development  >  How to implement php MD5 encryption 16-bit

How to implement php MD5 encryption 16-bit

WBOY
WBOYOriginal
2016-07-25 08:57:012150browse
  1. substr(md5("admin"),8,16); // 16-bit MD5 encryption
  2. md5("admin"); // 32-bit MD5 encryption
Copy code

php md5 16-bit and 32-bit implementation code

Code:

  1. echo substr(md5("admin"),8,16); // 16-bit MD5 encryption
  2. echo "
    ";
  3. echo md5("admin"); // 32-bit MD5 encryption
  4. ?>
Copy code

16-bit MD5 encryption is implemented by intercepting characters using the substr function.

Attachment: If you encounter an MD5 encrypted file and do not know the password, please replace this set of encrypted data in the database.

  1. echo md5("admin",true);//Return 16 digits
Copy code


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