DOKK / manpages / debian 12 / libcryptx-perl / Crypt::Digest::SHAKE.3pm.en
Crypt::Digest::SHAKE(3pm) User Contributed Perl Documentation Crypt::Digest::SHAKE(3pm)

Crypt::Digest::SHAKE - Hash functions SHAKE128, SHAKE256 from SHA3 family

   use Crypt::Digest::SHAKE
   $d = Crypt::Digest::SHAKE->new(128);
   $d->add('any data');
   $d->addfile('filename.dat');
   $d->addfile(*FILEHANDLE);
   $part1 = $d->done(100); # 100 raw bytes
   $part2 = $d->done(100); # another 100 raw bytes
   #...

Provides an interface to the SHA3's sponge function SHAKE.

 $d = Crypt::Digest::SHA3-SHAKE->new($num);
 # $num ... 128 or 256

 $d->clone();

 $d->reset();

 $d->add('any data');
 #or
 $d->add('any data', 'more data', 'even more data');

 $d->addfile('filename.dat');
 #or
 $d->addfile(*FILEHANDLE);

 $result_raw = $d->done($len);
 # can be called multiple times

  • CryptX, Crypt::Digest
  • <http://en.wikipedia.org/wiki/SHA-3>
2022-10-19 perl v5.36.0