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