public-inbox.git  about / heads / tags
an "archives first" approach to mailing lists
blob 5de0ee8ac3eb58d403a3b1bcf24d9920b0e4e4e5 539 bytes (raw)
$ git show fuse3:lib/PublicInbox/ContentDigestDbg.pm	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# only loaded in lei
package PublicInbox::ContentDigestDbg; # cf. PublicInbox::ContentDigest
use v5.12;
use Data::Dumper;
use PublicInbox::SHA;
$Data::Dumper::Useqq = $Data::Dumper::Terse = 1;

sub new { bless [ PublicInbox::SHA->new(256), $_[1] ], __PACKAGE__ }

sub add {
	$_[0]->[0]->add($_[1]);
	print { $_[0]->[1] } Dumper([split(/^/sm, $_[1])]) or die "print $!";
}

sub hexdigest { $_[0]->[0]->hexdigest }

1;

git clone https://public-inbox.org/public-inbox.git
git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git