Crypt::...PEMD160(3)
π Crypt::...PEMD160(3)
okay so bestie, this is the Crypt::...PEMD160(3) page from User Contributed Perl Documentation β also known in the wild as Crypt::Digest::RIPEMD160 β and we're gonna get you cozy with it. it's giving crypto-girlie energy fr fr π
β¨ NAME β¨
Crypt::Digest::RIPEMD160 β Hash function RIPEMD-160 [size: 160 bits] π¦
like literally the whole point, no cap.
πΈ SYNOPSIS πΈ
so here's the vibe. functional interface first:
### Functional interface:
use Crypt::Digest::RIPEMD160 qw( ripemd160 ripemd160_hex ripemd160_b64 ripemd160_b64u
ripemd160_file ripemd160_file_hex ripemd160_file_b64 ripemd160_file_b64u );
# calculate digest from string/buffer
my $data = 'data string';
my $ripemd160_raw = ripemd160($data);
my $ripemd160_hex = ripemd160_hex($data);
my $ripemd160_b64 = ripemd160_b64($data);
my $ripemd160_b64u = ripemd160_b64u($data);
# or from file
my $ripemd160_file_raw = ripemd160_file('filename.dat');
my $ripemd160_file_hex = ripemd160_file_hex('filename.dat');
my $ripemd160_file_b64 = ripemd160_file_b64('filename.dat');
my $ripemd160_file_b64u = ripemd160_file_b64u('filename.dat');
# or from filehandle
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd160_fh_raw = ripemd160_file($filehandle);
my $ripemd160_fh_hex = ripemd160_file_hex($filehandle);
my $ripemd160_fh_b64 = ripemd160_file_b64($filehandle);
my $ripemd160_fh_b64u = ripemd160_file_b64u($filehandle);
### OO interface:
use Crypt::Digest::RIPEMD160;
my $d = Crypt::Digest::RIPEMD160->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::RIPEMD160->new->addfile('filename.dat')->digest;
two whole ways to do the thing, pick your fighter πβ¨
π¦ DESCRIPTION π¦
it gives you an interface to the RIPEMD160 digest algorithm. that's literally it, that's the whole description β short and iconic π
π EXPORT π
bestie. listen. nothing is exported by default. you have to actually ask, okay? π
you can hand-pick which functions you want:
use Crypt::Digest::RIPEMD160 qw(ripemd160 ripemd160_hex ripemd160_b64 ripemd160_b64u
ripemd160_file ripemd160_file_hex ripemd160_file_b64 ripemd160_file_b64u);
or go feral and take all of them at once:
use Crypt::Digest::RIPEMD160 ':all';
main character energy honestly π
π₯ FUNCTIONS π₯
π ripemd160
joins all the arguments into one single string and returns its RIPEMD160 digest, encoded as a binary string (raw bytes, the spicy unreadable kind π).
about the data arguments for the functional helpers: they get converted to byte strings using Perl's usual scalar stringification. defined scalars β including numbers and string-overloaded objects β are accepted, so you're fine. undef is treated as an empty string and may emit Perl's usual "uninitialized value" warning (you know the one, the little scream in your logs π). and just so you know, the exact same rules apply to ripemd160_hex, ripemd160_b64, and ripemd160_b64u.
my $ripemd160_raw = ripemd160('data string');
#or
my $ripemd160_raw = ripemd160('any data', 'more data', 'even more data');
π ripemd160_hex
joins all arguments into a single string and returns its RIPEMD160 digest encoded as a hexadecimal string β¨
my $ripemd160_hex = ripemd160_hex('data string');
#or
my $ripemd160_hex = ripemd160_hex('any data', 'more data', 'even more data');
π ripemd160_b64
joins all arguments into a single string and returns its RIPEMD160 digest encoded as a Base64 string, with trailing '=' padding β yes the padding is staying, it's part of the fit π
my $ripemd160_b64 = ripemd160_b64('data string');
#or
my $ripemd160_b64 = ripemd160_b64('any data', 'more data', 'even more data');
π ripemd160_b64u
joins all arguments into a single string and returns its RIPEMD160 digest encoded as a Base64 URL-safe string (see RFC 4648 section 5). URL-safe, so it behaves in links, unlike some people π¦
my $ripemd160_b64url = ripemd160_b64u('data string');
#or
my $ripemd160_b64url = ripemd160_b64u('any data', 'more data', 'even more data');
π ripemd160_file
reads a file β given by a filename or a filehandle β and returns its RIPEMD160 digest encoded as a binary string.
my $ripemd160_raw = ripemd160_file('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd160_raw = ripemd160_file($filehandle);
π ripemd160_file_hex
reads a file given by a filename or filehandle and returns its RIPEMD160 digest encoded as a hexadecimal string.
my $ripemd160_hex = ripemd160_file_hex('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd160_hex = ripemd160_file_hex($filehandle);
β οΈ Note: the filehandle must be in binary mode before you pass it to addfile(). don't skip this step bestie, it's not a vibe π
π ripemd160_file_b64
reads a file given by a filename or filehandle and returns its RIPEMD160 digest encoded as a Base64 string, with trailing '=' padding.
my $ripemd160_b64 = ripemd160_file_b64('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd160_b64 = ripemd160_file_b64($filehandle);
π ripemd160_file_b64u
reads a file given by a filename or filehandle and returns its RIPEMD160 digest encoded as a Base64 URL-safe string (see RFC 4648 section 5).
my $ripemd160_b64url = ripemd160_file_b64u('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $ripemd160_b64url = ripemd160_file_b64u($filehandle);
π METHODS π
the OO interface provides the same set of functions as Crypt::Digest. unless noted otherwise, just assume $d is an existing digest object you made via new, like so:
my $d = Crypt::Digest::RIPEMD160->new();
π new
my $d = Crypt::Digest::RIPEMD160->new();
fresh digest object, brand new, baby's first hash π«Ά
π clone
$d->clone();
π reset
$d->reset();
π add
appends data to the message. returns the object itself, so you can chain β obsessed with a fluent API honestly π₯
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 (chaining again, slay β¨).
$d->addfile('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
$d->addfile($filehandle);
π hashsize
$d->hashsize;
#or
Crypt::Digest::RIPEMD160->hashsize();
#or
Crypt::Digest::RIPEMD160::hashsize();
three whole ways to ask the same question, iykyk π
π digest
returns the binary digest (raw bytes). the first call finalizes the digest object β and here's the important part, bestie: any later add(), addfile(), digest(), hexdigest(), b64digest(), or b64udigest() call will fail until you call reset(). it's done, it's closed, the door is shut π
my $result_raw = $d->digest();
π hexdigest
returns the digest encoded as a lowercase hexadecimal string. 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, you ate that π go forth and hash responsibly.
π§ cute little sign-off: this wasperl v5.42.0, dated2026-05-11, and yes, it's stillCrypt::...PEMD160(3)at the end of it all π
π¦ 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