Lines Matching refs:file
7 * Description: Generate a hash value using the contents of a given file
14 $file = __DIR__ . "hash_file.txt";
15 /* Creating a temporary file file */
16 if (($fp = fopen( $file, "w+")) == FALSE) {
17 echo "Cannot create file ($file)";
21 /* Writing into file */
23 if (is_writable($file)) {
25 echo "Cannot write to file ($file)";
30 // close the file
33 echo "adler32: " . hash_file('adler32', $file) . "\n";
34 echo "crc32: " . hash_file('crc32', $file) . "\n";
35 echo "gost: " . hash_file('gost', $file). "\n";
36 echo "haval128,3: " . hash_file('haval128,3', $file). "\n";
37 echo "md2: " . hash_file('md2', $file). "\n";
38 echo "md4: " . hash_file('md4', $file). "\n";
39 echo "md5: " . hash_file('md5', $file). "\n";
40 echo "ripemd128: " . hash_file('ripemd128', $file). "\n";
41 echo "ripemd160: " . hash_file('ripemd160', $file). "\n";
42 echo "ripemd256: " . hash_file('ripemd256', $file). "\n";
43 echo "ripemd320: " . hash_file('ripemd320', $file). "\n";
44 echo "sha1: " . hash_file('sha1', $file). "\n";
45 echo "sha256: " . hash_file('sha256', $file). "\n";
46 echo "sha384: " . hash_file('sha384', $file). "\n";
47 echo "sha512: " . hash_file('sha512', $file). "\n";
48 echo "snefru: " . hash_file('snefru', $file). "\n";
49 echo "tiger192,3: " . hash_file('tiger192,3', $file). "\n";
50 echo "whirlpool: " . hash_file('whirlpool', $file). "\n";
52 echo "adler32(raw): " . bin2hex(hash_file('adler32', $file, TRUE)) . "\n";
53 echo "md5(raw): " . bin2hex(hash_file('md5', $file, TRUE)). "\n";
54 echo "sha256(raw): " . bin2hex(hash_file('sha256', $file, TRUE)). "\n";
56 unlink($file);