Skip to content

Instantly share code, notes, and snippets.

@nikic
Created September 14, 2011 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikic/1216769 to your computer and use it in GitHub Desktop.
Save nikic/1216769 to your computer and use it in GitHub Desktop.
Index: ext/standard/tests/strings/md5_file.phpt
===================================================================
--- ext/standard/tests/strings/md5_file.phpt (revision 316568)
+++ ext/standard/tests/strings/md5_file.phpt (working copy)
@@ -56,7 +56,7 @@
/* Raw Binary Output for Empty file as input */
echo "\n*** Raw Binary Output for Empty file as Argument ***\n";
-var_dump( md5_file("EmptyFile.txt", true) );
+var_dump( bin2hex(md5_file("EmptyFile.txt", true)) );
/* Normal operation with hexadecimal output */
echo "\n*** Hexadecimal Output for a valid file with some contents ***\n";
@@ -64,7 +64,7 @@
/* Normal operation with raw binary output */
echo "\n*** Raw Binary Output for a valid file with some contents ***\n";
-var_dump ( md5_file("DataFile.txt", true) );
+var_dump ( bin2hex(md5_file("DataFile.txt", true)) );
// remove temp files
unlink("DataFile.txt");
@@ -97,12 +97,13 @@
string(32) "d41d8cd98f00b204e9800998ecf8427e"
*** Raw Binary Output for Empty file as Argument ***
-string(16) "Ԍُ
+string(32) "d41d8cd98f00b204e9800998ecf8427e"
+
*** Hexadecimal Output for a valid file with some contents ***
string(32) "7f28ec647825e2a70bf67778472cd4a2"
*** Raw Binary Output for a valid file with some contents ***
-string(16) "(ìdx%⧠öwxG,Ô¢"
+string(32) "7f28ec647825e2a70bf67778472cd4a2"
Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment