1--TEST--
2sha1() with ASCII output.
3--FILE--
4<?php
5
6
7echo "*** Testing sha1() : basic functionality ***\n";
8
9echo "\n-- Without raw argument --\n";
10var_dump(sha1(""));
11var_dump(sha1("a"));
12var_dump(sha1("abc"));
13var_dump(sha1("message digest"));
14var_dump(sha1("abcdefghijklmnopqrstuvwxyz"));
15var_dump(sha1("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"));
16var_dump(sha1("12345678901234567890123456789012345678901234567890123456789012345678901234567890"));
17
18echo "\n-- With raw == false --\n";
19var_dump(sha1("", false));
20var_dump(sha1("a", false));
21var_dump(sha1("abc", false));
22var_dump(sha1("message digest", false));
23var_dump(sha1("abcdefghijklmnopqrstuvwxyz", false));
24var_dump(sha1("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", false));
25var_dump(sha1("12345678901234567890123456789012345678901234567890123456789012345678901234567890", false));
26
27echo "\n-- With raw == true --\n";
28var_dump(bin2hex(sha1("", true)));
29var_dump(bin2hex(sha1("a", true)));
30var_dump(bin2hex(sha1("abc", true)));
31var_dump(bin2hex(sha1("message digest", true)));
32var_dump(bin2hex(sha1("abcdefghijklmnopqrstuvwxyz", true)));
33var_dump(bin2hex(sha1("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", true)));
34var_dump(bin2hex(sha1("12345678901234567890123456789012345678901234567890123456789012345678901234567890", true)));
35
36?>
37--EXPECT--
38*** Testing sha1() : basic functionality ***
39
40-- Without raw argument --
41string(40) "da39a3ee5e6b4b0d3255bfef95601890afd80709"
42string(40) "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8"
43string(40) "a9993e364706816aba3e25717850c26c9cd0d89d"
44string(40) "c12252ceda8be8994d5fa0290a47231c1d16aae3"
45string(40) "32d10c7b8cf96570ca04ce37f2a19d84240d3a89"
46string(40) "761c457bf73b14d27e9e9265c46f4b4dda11f940"
47string(40) "50abf5706a150990a08b2c5ea40fa0e585554732"
48
49-- With raw == false --
50string(40) "da39a3ee5e6b4b0d3255bfef95601890afd80709"
51string(40) "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8"
52string(40) "a9993e364706816aba3e25717850c26c9cd0d89d"
53string(40) "c12252ceda8be8994d5fa0290a47231c1d16aae3"
54string(40) "32d10c7b8cf96570ca04ce37f2a19d84240d3a89"
55string(40) "761c457bf73b14d27e9e9265c46f4b4dda11f940"
56string(40) "50abf5706a150990a08b2c5ea40fa0e585554732"
57
58-- With raw == true --
59string(40) "da39a3ee5e6b4b0d3255bfef95601890afd80709"
60string(40) "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8"
61string(40) "a9993e364706816aba3e25717850c26c9cd0d89d"
62string(40) "c12252ceda8be8994d5fa0290a47231c1d16aae3"
63string(40) "32d10c7b8cf96570ca04ce37f2a19d84240d3a89"
64string(40) "761c457bf73b14d27e9e9265c46f4b4dda11f940"
65string(40) "50abf5706a150990a08b2c5ea40fa0e585554732"
66