Crypt::...irlpool(3)

✨ NAME ✨

okay so bestie, this is the Perl manual page for Crypt::Digest::Whirlpool β€” the Crypt::...irlpool(3) one, straight from the User Contributed Perl Documentation aisle πŸ’–. It's the interface for Hash function Whirlpool [size: 512 bits], and it's giving hash-function main character energy, no cap. πŸŒ€πŸ‘‘

🌸 SYNOPSIS 🌸

bestie, here's the whole vibe in code form β€” functional interface on top, OO interface below, both iconic 🫢:

          ### Functional interface:
          use Crypt::Digest::Whirlpool qw( whirlpool whirlpool_hex whirlpool_b64 whirlpool_b64u
                                       whirlpool_file whirlpool_file_hex whirlpool_file_b64 whirlpool_file_b64u );

          # calculate digest from string/buffer
          my $data = 'data string';
          my $whirlpool_raw  = whirlpool($data);
          my $whirlpool_hex  = whirlpool_hex($data);
          my $whirlpool_b64  = whirlpool_b64($data);
          my $whirlpool_b64u = whirlpool_b64u($data);
          # or from file
          my $whirlpool_file_raw  = whirlpool_file('filename.dat');
          my $whirlpool_file_hex  = whirlpool_file_hex('filename.dat');
          my $whirlpool_file_b64  = whirlpool_file_b64('filename.dat');
          my $whirlpool_file_b64u = whirlpool_file_b64u('filename.dat');
          # or from filehandle
          my $filehandle = ...; # existing binary-mode filehandle
          my $whirlpool_fh_raw  = whirlpool_file($filehandle);
          my $whirlpool_fh_hex  = whirlpool_file_hex($filehandle);
          my $whirlpool_fh_b64  = whirlpool_file_b64($filehandle);
          my $whirlpool_fh_b64u = whirlpool_file_b64u($filehandle);

          ### OO interface:
          use Crypt::Digest::Whirlpool;

          my $d = Crypt::Digest::Whirlpool->new;
          $d->add('any data');
          my $result_raw  = $d->digest;     # raw bytes
          my $result_hex  = $d->hexdigest;  # hexadecimal form
          my $result_b64  = $d->b64digest;  # Base64 form
          my $result_b64u = $d->b64udigest; # Base64 URL-safe form

          # or hash a file instead
          my $file_result_raw = Crypt::Digest::Whirlpool->new->addfile('filename.dat')->digest;

πŸ’– DESCRIPTION πŸ’–

okay so this module literally provides an interface to the Whirlpool digest algorithm ✨. That's the whole assignment: Whirlpool, wrapped in Perl, ready for ur hashing era. It ate, it slayed, it's 512 bits of iconic. πŸŒ€πŸ’…

πŸ›οΈ EXPORT πŸ›οΈ

Nothing is exported by default, bestie. That's the default vibe. But you can export selected functions if you want, like this:

         use Crypt::Digest::Whirlpool qw(whirlpool whirlpool_hex whirlpool_b64 whirlpool_b64u
                                             whirlpool_file whirlpool_file_hex whirlpool_file_b64 whirlpool_file_b64u);

Or go full main character and export all of them at once:

         use Crypt::Digest::Whirlpool ':all';

πŸ”₯ FUNCTIONS πŸ”₯

okay here come the functional helpers, all iconic, all useful. 🫢

πŸŒ€ whirlpool

Joins all arguments into a single string and returns its Whirlpool digest encoded as a binary string. Raw bytes, no filter. 🧬

Data arguments for the functional helpers are converted to byte strings 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. The same rules apply to whirlpool_hex, whirlpool_b64, and whirlpool_b64u. πŸ‘€

 my $whirlpool_raw = whirlpool('data string');
 #or
 my $whirlpool_raw = whirlpool('any data', 'more data', 'even more data');

🌈 whirlpool_hex

Joins all arguments into a single string and returns its Whirlpool digest encoded as a hexadecimal string. Hex girl summer πŸ’…

 my $whirlpool_hex = whirlpool_hex('data string');
 #or
 my $whirlpool_hex = whirlpool_hex('any data', 'more data', 'even more data');

πŸŽ€ whirlpool_b64

Joins all arguments into a single string and returns its Whirlpool digest encoded as a Base64 string, with trailing '=' padding. The padding is part of the look, periodt. πŸŽ€

 my $whirlpool_b64 = whirlpool_b64('data string');
 #or
 my $whirlpool_b64 = whirlpool_b64('any data', 'more data', 'even more data');

πŸ¦‹ whirlpool_b64u

Joins all arguments into a single string and returns its Whirlpool digest encoded as a Base64 URL-safe string (see RFC 4648 section 5). URL-safe and unbothered. πŸ¦‹

 my $whirlpool_b64url = whirlpool_b64u('data string');
 #or
 my $whirlpool_b64url = whirlpool_b64u('any data', 'more data', 'even more data');

πŸ“ whirlpool_file

Reads a file given by a filename or filehandle and returns its Whirlpool digest encoded as a binary string. File hashing, but make it cute. πŸ“

 my $whirlpool_raw = whirlpool_file('filename.dat');
 #or
 my $filehandle = ...; # existing binary-mode filehandle
 my $whirlpool_raw = whirlpool_file($filehandle);

🌸 whirlpool_file_hex

Reads a file given by a filename or filehandle and returns its Whirlpool digest encoded as a hexadecimal string. Hex from a file? Obsessed. 🌸

 my $whirlpool_hex = whirlpool_file_hex('filename.dat');
 #or
 my $filehandle = ...; # existing binary-mode filehandle
 my $whirlpool_hex = whirlpool_file_hex($filehandle);
Note: The filehandle must be in binary mode before you pass it to addfile(). This is important, bestie β€” binary mode or it's not giving what it needs to give. 😭

🧚 whirlpool_file_b64

Reads a file given by a filename or filehandle and returns its Whirlpool digest encoded as a Base64 string, with trailing '=' padding. File-to-Base64 pipeline, iconic. 🧚

 my $whirlpool_b64 = whirlpool_file_b64('filename.dat');
 #or
 my $filehandle = ...; # existing binary-mode filehandle
 my $whirlpool_b64 = whirlpool_file_b64($filehandle);

πŸ’œ whirlpool_file_b64u

Reads a file given by a filename or filehandle and returns its Whirlpool digest encoded as a Base64 URL-safe string (see RFC 4648 section 5). URL-safe file digest, very demure, very mindful. πŸ’œ

 my $whirlpool_b64url = whirlpool_file_b64u('filename.dat');
 #or
 my $filehandle = ...; # existing binary-mode filehandle
 my $whirlpool_b64url = whirlpool_file_b64u($filehandle);

πŸ’… METHODS πŸ’…

The OO interface provides the same set of functions as Crypt::Digest. Unless noted otherwise, assume $d is an existing digest object created via new, for example:

 my $d = Crypt::Digest::Whirlpool->new();

Now let's meet the methods, bestie. 🫢

⭐ new

Fresh digest object, new era. ✨

 my $d = Crypt::Digest::Whirlpool->new();

πŸŽ€ clone

Clone the vibe. πŸŽ€

 $d->clone();

πŸ”„ reset

Reset button, iconic. πŸ”„

 $d->reset();

πŸ“ hashsize

Hashsize check, no biggie. πŸ“

 $d->hashsize;
 #or
 Crypt::Digest::Whirlpool->hashsize();
 #or
 Crypt::Digest::Whirlpool::hashsize();

🧬 add

Appends data to the message. Returns the object itself (for chaining). Chain it, bestie. πŸ”—

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). File content, but make it chain. πŸ“

 $d->addfile('filename.dat');
 #or
 my $filehandle = ...; # existing binary-mode filehandle
 $d->addfile($filehandle);

🧾 digest

Returns the binary digest (raw bytes). The first call finalizes the digest object. Any later add(), addfile(), digest(), hexdigest(), b64digest(), or b64udigest() call will fail until you call reset(). So yeah, bestie, finalization is a one-way door until reset. πŸšͺ😭

 my $result_raw = $d->digest();

πŸ”€ hexdigest

Returns the digest encoded as a lowercase hexadecimal string. Like digest(), the first call finalizes the digest object. Lowercase hex, as it should be. πŸ”€

 my $result_hex = $d->hexdigest();

🎁 b64digest

Returns the digest encoded as a Base64 string with trailing "=" padding. Like digest(), the first call finalizes the digest object. Padding included, because we love a complete look. 🎁

 my $result_b64 = $d->b64digest();

πŸ¦‹ b64udigest

Returns the digest encoded as a Base64 URL-safe string (no trailing "="). Like digest(), the first call finalizes the digest object. No padding, all URL-safe confidence. πŸ¦‹

 my $result_b64url = $d->b64udigest();

🌟 SEE ALSO 🌟

okay that's the whole page, bestie 🫢 source/version: perl v5.42.0; date: 2026-05-11; manual name: Crypt::...irlpool(3). slay and goodbye πŸ’–

πŸ“¦ where this page comes from