Hacker News new | ask | show | jobs
by cyberbanjo 1670 days ago
Do you know why that is?

  php > echo md5('240610708');
  0e462097431906509019562988736854

  php > echo md5('QNKCDZO');
  0e830400451993494058024219903391
2 comments

Would this be avoided by using a string comparison function?

https://www.php.net/manual/en/function.strcmp.php

Yes, or you can use ===, which will check the type as well. I am trying to get in the habit of using === everywhere now.
Yes.

  php > echo strcmp(md5('240610708'), md5('QNKCDZO'));
  -4