PHP md5() gives different output then MySQL md5

倾然丶 夕夏残阳落幕 提交于 2019-12-05 05:23:51

I guess the problem in the length of column of your table, set the length of password field to at least 32

No way MySQL returns it of a length of < 32. If you would do a simple query like SELECT md5('brickmasterj'), you would see. Now you are most likely inserting the value into a column which is not wide enough.

Is your database field 32 characters long? Are you writing to the database using mysql's md5?

The hash size if always fixed. In your case the hash size is 128 bits. When converted to a ascii string it would be a 32 character string that contains only hexadecimal digits. so if you are storing variable character the length should be atleast 32 example:password varchar(32) should go in mysql table then you can call using php using select password from table where password =md5($password);

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!