source: branches/version-2_5-dev/data/module/Compat/tests/function/hash.phpt @ 20116

Revision 20116, 812 bytes checked in by nanasess, 13 years ago (diff)
  • svn properties を再設定
  • 再設定用のスクリプト追加
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
Line 
1--TEST--
2Function -- hash
3--FILE--
4<?php
5require_once 'PHP/Compat/Function/hash.php';
6
7$content = "This is a sample string used to test the hash function with various hashing algorithms";
8
9echo "md5: " . php_compat_hash('md5', $content). "\n";
10echo "sha1: " . php_compat_hash('sha1', $content). "\n";
11echo "sha256: " . php_compat_hash('sha256', $content). "\n";
12echo "md5(raw): " . bin2hex(php_compat_hash('md5', $content, true)). "\n";
13echo "sha256(raw): " . bin2hex(php_compat_hash('sha256', $content, true)). "\n";
14
15?>
16--EXPECT--
17md5: bf33deeefaf5a9413160935be950cc07
18sha1: f0dc0e88cc1008e46762f40a1b4a4c0b6baedfa0
19sha256: a78149615dd1ef8aeb22a8254c36edd87713f2e79a052a89ff32ed94e827d47b
20md5(raw): bf33deeefaf5a9413160935be950cc07
21sha256(raw): a78149615dd1ef8aeb22a8254c36edd87713f2e79a052a89ff32ed94e827d47b
Note: See TracBrowser for help on using the repository browser.