]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/ContentDigestDbg.pm
No ext_urls
[public-inbox.git] / lib / PublicInbox / ContentDigestDbg.pm
1 # Copyright (C) all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 # only loaded in lei
4 package PublicInbox::ContentDigestDbg; # cf. PublicInbox::ContentDigest
5 use v5.12;
6 use Data::Dumper;
7 use PublicInbox::SHA;
8 $Data::Dumper::Useqq = $Data::Dumper::Terse = 1;
9
10 sub new { bless [ PublicInbox::SHA->new(256), $_[1] ], __PACKAGE__ }
11
12 sub add {
13         $_[0]->[0]->add($_[1]);
14         print { $_[0]->[1] } Dumper([split(/^/sm, $_[1])]) or die "print $!";
15 }
16
17 sub hexdigest { $_[0]->[0]->hexdigest }
18
19 1;