Today I made a php link to a mssql database. The fields in the tables in the database are encrypted using MD516. However, the default MD5 in PHP is 32 bits, which makes it impossible for the login program to use md5 encryption to match the fields in the table. Many people were confused about this when searching online. Later, I found a solution and it was correct, so I recorded it. Come down
Use the substr function to intercept:
substr(md5("admin"),8,16); // 16位MD5加密 md5("admin"); // 32位MD5加密
For more PHP-enabled MD5 encryption 16-bit (not the default 32-bit) related articles, please pay attention to the PHP Chinese website!