cb336c2cf61520b7db1f9e592600abe4be4034d7
# subclass is supposed to implement at least these
my ($self, $handle) = @_;
while (($n = read($handle, $buf, 4*1024))) {
Carp::croak("Read failed: $!");
$bits = pack("B*", $arg);
Carp::croak("Number of bits must be multiple of 8 for this algorithm");
return $self->add(substr($bits, 0, $nbits/8));
return unpack("H*", $self->digest(@_));
my $b64 = MIME::Base64::encode($self->digest(@_), "");
Digest::base - Digest base class
The C<Digest::base> class provide implementations of the methods
C<addfile> and C<add_bits> in terms of C<add>, and of the methods
C<hexdigest> and C<b64digest> in terms of C<digest>.
Digest implementations might want to inherit from this class to get
this implementations of the alternative I<add> and I<digest> methods.
A minimal subclass needs to implement the following methods by itself:
The arguments and expected behaviour of these methods are described in