PHP MD5 encrypted 16-bit and 32-bit implementation code, a search on the internet there are many people have this confusion, and later found a solution, is correct, recorded
The code is as follows:
<?php Echo substr (MD5 ("admin"), 8,16); 16-bit MD5 encryption echo "
The 16-bit MD5 encryption uses the SUBSTR function to intercept the characters to be implemented ....
Don't want to delve into it: Put your brain on the other key areas
Today made a PHP link MSSQL database, the table in the database field using MD5 16 encryption. But PHP in the default is 32-bit, resulting in the login program can not use MD5 encryption with the table field matching, in the online a search there are many people have this confusion, and later found a solution, is correct, on record down.
Use the SUBSTR function to intercept:
SUBSTR (MD5 ("admin"), 8,16); 16-bit MD5 encryption
MD5 ("admin"); 32-bit MD5 encryption
After this site test results are as follows:
We compare the results after several MD5 of ASP
Attached: If you encounter MD5 encrypted files, but do not know the password, please exchange this set of encrypted data in the database.
Admin---16-bit encryption---7a57a5a743894a0e
Admin---32-bit encryption---21232F297A57A5A743894A0E4A801FC3
Admin---40-bit encryption---7A57A5A743894A0E4A801FC343894A0E4A801FC3
SUBSTR (MD5 ("admin"), 8,16); 16-bit MD5 encryption is exactly 32 of the 16 characters starting with the 8th character. So you don't have to think about the uniqueness of the problem. is right in itself. Someone online says PHP5 support
The code is as follows:
echo MD5 ("admin", true);//returns 16 bits, but this is only in PHP5.
The results of the test output is garbled, if you have any good code, you can share the next.
The above describes the TOTALMEDIATHEATRE5 PHP MD5 16-bit and 32-bit implementation code, including the totalmediatheatre5 aspect of the content, I hope to be interested in PHP tutorial friends helpful.