简体   繁体   中英

Why is my binary(64) 60 char password hash shown as 60 characters in phpmyadmin, but upon exporting has four '\0's on the end?

I know \\0 is ending strings. Why are there four? And why, in my php code, do I have to specifically take the substring of first 60 characters in order for password_verify to work? (eg $passhash = substr($result, 0, 60); )

Thanks for any and all help.

PHPMyAdmin is simply not displaying this to you.

You have a 64-byte field. It's always going to be 64 bytes. If you have 60 bytes used, the last four are going to be null bytes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM