Skip Menu |

This queue is for tickets about the Digest-SHA CPAN distribution.

Report information
The Basics
Id: 95643
Status: resolved
Priority: 0/
Queue: Digest-SHA

People
Owner: mshelor [...] cpan.org
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 5.90
Fixed in: 5.91



Subject: Digest::SHA breaks IO::Callback
This code (from test of IO::Callback) no longer works use IO::Callback; my $block = "foo\n" x 1000; my $lines = 0; my $fh = IO::Callback->new('<', sub { return if $lines++ >= 1000; return $block; }); my $digest = Digest::SHA->new(256)->addfile($fh)->hexdigest; -- Alexandr Ciornii, http://chorny.net
On Wed May 14 11:09:24 2014, CHORNY wrote: Show quoted text
> This code (from test of IO::Callback) no longer works > > use IO::Callback; > > my $block = "foo\n" x 1000; > my $lines = 0; > my $fh = IO::Callback->new('<', sub { > return if $lines++ >= 1000; > return $block; > }); > > my $digest = Digest::SHA->new(256)->addfile($fh)->hexdigest; > >
Thanks for bringing this to my notice. The solution is to use the pre-5.89 implementation of 'addfile' (taken from Digest::base) for already-opened file handles. Fortunately the modification won't interfere with the new, much-faster 'addfilebin' which will still be used for files passed in by name. The next release (5.91, TBS) of Digest::SHA and Digest::SHA3 will resolve this ticket. Mark
Fixed in 5.91