fork(6) download
  1. <?php
  2.  
  3. $hex1 = '4dc968ff0ee35c209572d4777b721587d36fa7b21bdc56b74a3dc0783e7b9518afbfa200a8284bf36e8e4b55b35f427593d849676da0d1555d8360fb5f07fea2';
  4. $hex2 = '4dc968ff0ee35c209572d4777b721587d36fa7b21bdc56b74a3dc0783e7b9518afbfa202a8284bf36e8e4b55b35f427593d849676da0d1d55d8360fb5f07fea2';
  5.  
  6. $bin1 = hex2bin($hex1);
  7. $bin2 = hex2bin($hex2);
  8.  
  9. if ($bin1 == $bin2)
  10. echo 'The binary data is the same' . PHP_EOL;
  11. else
  12. echo 'The binary data is not the same' . PHP_EOL . PHP_EOL;
  13.  
  14. $md51 = md5($bin1);
  15. $md52 = md5($bin2);
  16.  
  17. echo 'MD5 hash for binary #1: ' . $md51 . PHP_EOL;
  18. echo 'MD5 hash for binary #2: ' . $md52 . PHP_EOL;
  19.  
  20. if ($md51 == $md52)
  21. echo 'The MD5 hashes are the same' . PHP_EOL;
  22. else
  23. echo 'The MD5 hashes are not the same' . PHP_EOL;
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
The binary data is not the same

MD5 hash for binary #1: 008ee33a9d58b51cfeb425b0959121c9
MD5 hash for binary #2: 008ee33a9d58b51cfeb425b0959121c9
The MD5 hashes are the same