Crypt::...PEMD256(3)
π Crypt::Digest::RIPEMD256(3) π
okay so bestie, quick heads up: this whole page is from User Contributed Perl Documentation, and it's the manual for Crypt::Digest::RIPEMD256. The header up top gets squished into Crypt::...PEMD256(3) because terminals are dramatic and truncate things π
β the real name is the long one, promise.
β¨ NAME β¨
Crypt::Digest::RIPEMD256 β hash function RIPEMD-256 [size: 256 bits]
π¦ SYNOPSIS π¦
here's the whole vibe, functional style first:
### Functional interface:
use Crypt::Digest::RIPEMD256 qw( ripemd256 ripemd256_hex ripemd256_b64 ripemd256_b64u
ripemd256_file ripemd256_file_hex ripemd256_file_b64 ripemd256_file_b64u );
# calculate digest from string/buffer
my $data = 'data string';
my $ripemd256_raw = ripemd256($data);
my $ripemd256_hex = ripemd256_hex($data);
my $ripemd256_b64 = ripemd256_b64($data);
my $ripemd256_b64u = ripemd256_b64u($data);
# or from file
my $ripemd256_file_raw = ripemd256_file('filename.dat');
my $ripemd256_file_hex = ripemd256_file_hex('filename.dat');
my $ripemd256_file_b64 = ripemd256_file_b64('filename.dat');
my $ripemd256_file_b64u = ripemd256_file_b64u('filename.dat');
# or from filehandle
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd256_fh_raw = ripemd256_file($filehandle);
my $ripemd256_fh_hex = ripemd256_file_hex($filehandle);
my $ripemd256_fh_b64 = ripemd256_file_b64($filehandle);
my $ripemd256_fh_b64u = ripemd256_file_b64u($filehandle);
### OO interface:
use Crypt::Digest::RIPEMD256;
my $d = Crypt::Digest::RIPEMD256->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::RIPEMD256->new->addfile('filename.dat')->digest;
πΈ DESCRIPTION πΈ
it hands you an interface to the RIPEMD256 digest algorithm. that's the whole thing. iconic, honestly π
π EXPORT π
nothing is exported by default. like, at all. zero. π
but you can pick and choose your faves:
use Crypt::Digest::RIPEMD256 qw(ripemd256 ripemd256_hex ripemd256_b64 ripemd256_b64u
ripemd256_file ripemd256_file_hex ripemd256_file_b64 ripemd256_file_b64u);
or just grab the whole squad at once:
use Crypt::Digest::RIPEMD256 ':all';
π₯ FUNCTIONS π₯
π« ripemd256
it joins all your arguments into one single string and returns its RIPEMD256 digest, encoded as a binary string. so raw. so real.
about those data arguments β for the functional helpers they get converted to byte strings using Perl's usual scalar stringification. defined scalars are accepted, including numbers and string-overloaded objects. undef is treated as an empty string and may emit Perl's usual "uninitialized value" warning. same rules apply to ripemd256_hex, ripemd256_b64, and ripemd256_b64u. iykyk π«Ά
my $ripemd256_raw = ripemd256('data string');
#or
my $ripemd256_raw = ripemd256('any data', 'more data', 'even more data');
π« ripemd256_hex
joins all your arguments into one string and hands back the RIPEMD256 digest as a hexadecimal string. hex girl summer β¨
my $ripemd256_hex = ripemd256_hex('data string');
#or
my $ripemd256_hex = ripemd256_hex('any data', 'more data', 'even more data');
π« ripemd256_b64
joins all your arguments into one string, then returns the RIPEMD256 digest encoded as a Base64 string, with trailing '=' padding. the padding stays, she's not going anywhere π
my $ripemd256_b64 = ripemd256_b64('data string');
#or
my $ripemd256_b64 = ripemd256_b64('any data', 'more data', 'even more data');
π« ripemd256_b64u
joins all your arguments into one string and returns the RIPEMD256 digest encoded as a Base64 URL-safe string (see RFC 4648 section 5). url-safe is her main character era π
my $ripemd256_b64url = ripemd256_b64u('data string');
#or
my $ripemd256_b64url = ripemd256_b64u('any data', 'more data', 'even more data');
π« ripemd256_file
reads a file β either by filename or by filehandle β and returns its RIPEMD256 digest encoded as a binary string.
my $ripemd256_raw = ripemd256_file('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd256_raw = ripemd256_file($filehandle);
π« ripemd256_file_hex
reads a file given by a filename or a filehandle and returns its RIPEMD256 digest encoded as a hexadecimal string.
my $ripemd256_hex = ripemd256_file_hex('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd256_hex = ripemd256_file_hex($filehandle);
β οΈ note, bestie: the filehandle must be in binary mode before you pass it to addfile(). no cap, don't skip this step π
π« ripemd256_file_b64
reads a file given by a filename or filehandle and returns its RIPEMD256 digest encoded as a Base64 string, with trailing '=' padding.
my $ripemd256_b64 = ripemd256_file_b64('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd256_b64 = ripemd256_file_b64($filehandle);
π« ripemd256_file_b64u
reads a file given by a filename or filehandle and returns its RIPEMD256 digest encoded as a Base64 URL-safe string (see RFC 4648 section 5).
my $ripemd256_b64url = ripemd256_file_b64u('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd256_b64url = ripemd256_file_b64u($filehandle);
π METHODS π
the OO interface serves the exact same set of functions as Crypt::Digest. unless it says otherwise, just assume $d is an existing digest object made via new, like so:
my $d = Crypt::Digest::RIPEMD256->new();
π§ new
my $d = Crypt::Digest::RIPEMD256->new();
π§ clone
$d->clone();
π§ reset
$d->reset();
π§ add
appends data to the message and returns the object itself (chaining, we love her π«Ά).
each argument gets converted to bytes using Perl's usual scalar stringification. defined scalars β numbers and string-overloaded objects included β 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 (chaining again, periodt).
$d->addfile('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
$d->addfile($filehandle);
π§ hashsize
$d->hashsize;
#or
Crypt::Digest::RIPEMD256->hashsize();
#or
Crypt::Digest::RIPEMD256::hashsize();
π§ digest
returns the binary digest (raw bytes). the first call finalizes the digest object β and after that, any later add(), addfile(), digest(), hexdigest(), b64digest(), or b64udigest() call will fail until you call reset(). she's done, she's closed the group chat π
my $result_raw = $d->digest();
π§ hexdigest
returns the digest encoded as a lowercase hexadecimal string. just like digest(), the first call finalizes the digest object.
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.
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.
my $result_b64url = $d->b64udigest();
β SEE ALSO β
CryptX,Crypt::Digest- <https://en.wikipedia.org/wiki/RIPEMD>
and that's the whole page, bestie π β brought to you by perl v5.42.0, dated 2026-05-11. go forth and hash responsibly πβ¨
π¦ 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