Commit | Line | Data |
6bc89f92 |
1 | use Test; |
2 | use strict; |
3 | use integer; |
4 | use Digest::SHA; |
5 | |
41c686de |
6 | BEGIN { |
77d2a621 |
7 | if ($ENV{PERL_CORE}) { |
8 | chdir 't' if -d 't'; |
9 | @INC = '../lib'; |
10 | } |
41c686de |
11 | } |
12 | |
6bc89f92 |
13 | BEGIN { plan tests => 1 } |
14 | |
15 | my $i; |
16 | my $bitstr = pack("B*", "11111111" x 10000); |
17 | my $state = Digest::SHA->new("1"); |
18 | |
19 | $state->add_bits($bitstr, 1); # creates an alignment nuisance |
20 | for ($i = 0; $i < 99; $i++) { |
21 | $state->add_bits($bitstr, 80000); |
22 | } |
23 | $state->add_bits($bitstr, 79999); |
24 | |
25 | ok( |
26 | $state->hexdigest, |
27 | "559a512393dd212220ee080730d6f11644ba0222" |
28 | ); |