Crypt::...rboSHAKE(3)
π Crypt::...rboSHAKE(3) π
okay bestie, welcome to the User Contributed Perl Documentation glow-up of Crypt::...rboSHAKE(3) β this is the manual page for Crypt::Digest::TurboSHAKE, and it's giving secure-hash main character energy β¨
π NAME π
Crypt::Digest::TurboSHAKE β XOF (extendable output) hash functions TurboSHAKE128 and TurboSHAKE256. periodt π
β¨ SYNOPSIS β¨
use Crypt::Digest::TurboSHAKE;
my $d = Crypt::Digest::TurboSHAKE->new(128); # TurboSHAKE128
$d->add('any data');
my $result = $d->done(32); # 32 bytes of output
# or absorb input from a file instead
my $file_d = Crypt::Digest::TurboSHAKE->new(128);
$file_d->addfile('filename.dat');
my $file_result = $file_d->done(32);
π¦ DESCRIPTION π¦
quick vibe check: Since: CryptX-0.089 π«Ά
This module provides an interface to TurboSHAKE128 and TurboSHAKE256 as defined in RFC 9861 (https://www.rfc-editor.org/rfc/rfc9861).
TurboSHAKE is a faster variant of SHAKE based on the reduced-round KeccakP-1600 permutation. Like SHAKE, it is an XOF (extendable output function): done() can be called multiple times to stream arbitrary amounts of output. literally so iconic π«
bestie, after the firstdone(), treat the object as being in output mode: do not calladd()again on that state. Usereset()or a new object to start hashing a new message. no cap π¨
π§ METHODS π§
Unless noted otherwise, assume $d is an existing TurboSHAKE object created via new, for example:
my $d = Crypt::Digest::TurboSHAKE->new(128);
π new π
my $d = Crypt::Digest::TurboSHAKE->new($num);
# $num ... [integer] 128 or 256 (selects TurboSHAKE128 or TurboSHAKE256)
$num is an [integer] β 128 or 256 β and those pick TurboSHAKE128 or TurboSHAKE256 respectively. iykyk π
π clone π
my $d2 = $d->clone;
just the signature on this one, bestie π
πΈ reset πΈ
$d->reset;
also just the signature β short and sweet π
π add π
Appends data to the message. Returns the object itself (for chaining). slay π₯
Each argument is converted to bytes using Perl's usual scalar stringification. Defined scalars, including numbers and string-overloaded objects, are accepted. undef is treated as an empty string and may emit Perl's usual "uninitialized value" warning.
$d->add('any data');
#or
$d->add('any data', 'more data', 'even more data');
π addfile π
Reads the file content and appends it to the message. Returns the object itself (for chaining).
$d->addfile('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
$d->addfile($filehandle);
π₯ done π₯
Returns $len bytes of output as a binary string. Can be called repeatedly to stream an unlimited amount of output from the same absorbed input. The $len argument is required and must be a positive integer. Single done() calls are limited to 1,000,000,000 bytes, but the recommended way to read large output is to call done() repeatedly in 10 MB chunks.
After the first done() call the object is in output mode. Calling add() in this state croaks; use reset() or create a new object to hash a different message.
my $result_raw = $d->done($len);
# can be called multiple times; $len is the number of output bytes to read
# after the first done(), add() croaks until you call reset()
π SEE ALSO π
CryptX,Crypt::Digest::SHAKE,Crypt::Digest::KangarooTwelve- RFC 9861 (
https://www.rfc-editor.org/rfc/rfc9861)
mwah π this page was brought to you by perl v5.42.0, dated 2026-05-11, filed under Crypt::...rboSHAKE(3) in the User Contributed Perl Documentation. go hash something iconic π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms