| Revision 20119,
812 bytes
checked in by nanasess, 15 years ago
(diff) |
|
module 以下は svn:keywords を除外
|
-
Property svn:eol-style set to
LF
|
| Line | |
|---|
| 1 | --TEST-- |
|---|
| 2 | Function -- hash |
|---|
| 3 | --FILE-- |
|---|
| 4 | <?php |
|---|
| 5 | require_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 | |
|---|
| 9 | echo "md5: " . php_compat_hash('md5', $content). "\n"; |
|---|
| 10 | echo "sha1: " . php_compat_hash('sha1', $content). "\n"; |
|---|
| 11 | echo "sha256: " . php_compat_hash('sha256', $content). "\n"; |
|---|
| 12 | echo "md5(raw): " . bin2hex(php_compat_hash('md5', $content, true)). "\n"; |
|---|
| 13 | echo "sha256(raw): " . bin2hex(php_compat_hash('sha256', $content, true)). "\n"; |
|---|
| 14 | |
|---|
| 15 | ?> |
|---|
| 16 | --EXPECT-- |
|---|
| 17 | md5: bf33deeefaf5a9413160935be950cc07 |
|---|
| 18 | sha1: f0dc0e88cc1008e46762f40a1b4a4c0b6baedfa0 |
|---|
| 19 | sha256: a78149615dd1ef8aeb22a8254c36edd87713f2e79a052a89ff32ed94e827d47b |
|---|
| 20 | md5(raw): bf33deeefaf5a9413160935be950cc07 |
|---|
| 21 | sha256(raw): a78149615dd1ef8aeb22a8254c36edd87713f2e79a052a89ff32ed94e827d47b |
|---|
Note: See
TracBrowser
for help on using the repository browser.