简体   繁体   English

为什么我的binary(64)60 char密码哈希在phpmyadmin中显示为60个字符,但是导出时末尾有四个'\\ 0'?

[英]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. 我知道\\ 0是结束字符串。 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? 为什么在我的PHP代码中,我必须专门使用前60个字符的子字符串才能使password_verify起作用? (eg $passhash = substr($result, 0, 60); ) (例如$passhash = substr($result, 0, 60);

Thanks for any and all help. 感谢您提供的所有帮助。

PHPMyAdmin is simply not displaying this to you. PHPMyAdmin根本不会向您显示此内容。

You have a 64-byte field. 您有一个64字节的字段。 It's always going to be 64 bytes. 总是64字节。 If you have 60 bytes used, the last four are going to be null bytes. 如果使用了60个字节,则最后四个将为空字节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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