.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Crypt::Digest::RIPEMD128 3pm" .TH Crypt::Digest::RIPEMD128 3pm 2026-07-04 "perl v5.40.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Crypt::Digest::RIPEMD128 \- Hash function RIPEMD\-128 [size: 128 bits] .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& ### Functional interface: \& use Crypt::Digest::RIPEMD128 qw( ripemd128 ripemd128_hex ripemd128_b64 ripemd128_b64u \& ripemd128_file ripemd128_file_hex ripemd128_file_b64 ripemd128_file_b64u ); \& \& # calculate digest from string/buffer \& my $data = \*(Aqdata string\*(Aq; \& my $ripemd128_raw = ripemd128($data); \& my $ripemd128_hex = ripemd128_hex($data); \& my $ripemd128_b64 = ripemd128_b64($data); \& my $ripemd128_b64u = ripemd128_b64u($data); \& # or from file \& my $ripemd128_file_raw = ripemd128_file(\*(Aqfilename.dat\*(Aq); \& my $ripemd128_file_hex = ripemd128_file_hex(\*(Aqfilename.dat\*(Aq); \& my $ripemd128_file_b64 = ripemd128_file_b64(\*(Aqfilename.dat\*(Aq); \& my $ripemd128_file_b64u = ripemd128_file_b64u(\*(Aqfilename.dat\*(Aq); \& # or from filehandle \& my $filehandle = ...; # existing binary\-mode filehandle \& my $ripemd128_fh_raw = ripemd128_file($filehandle); \& my $ripemd128_fh_hex = ripemd128_file_hex($filehandle); \& my $ripemd128_fh_b64 = ripemd128_file_b64($filehandle); \& my $ripemd128_fh_b64u = ripemd128_file_b64u($filehandle); \& \& ### OO interface: \& use Crypt::Digest::RIPEMD128; \& \& my $d = Crypt::Digest::RIPEMD128\->new; \& $d\->add(\*(Aqany data\*(Aq); \& 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::RIPEMD128\->new\->addfile(\*(Aqfilename.dat\*(Aq)\->digest; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Provides an interface to the RIPEMD128 digest algorithm. .SH EXPORT .IX Header "EXPORT" Nothing is exported by default. .PP You can export selected functions: .PP .Vb 2 \& use Crypt::Digest::RIPEMD128 qw(ripemd128 ripemd128_hex ripemd128_b64 ripemd128_b64u \& ripemd128_file ripemd128_file_hex ripemd128_file_b64 ripemd128_file_b64u); .Ve .PP Or all of them at once: .PP .Vb 1 \& use Crypt::Digest::RIPEMD128 \*(Aq:all\*(Aq; .Ve .SH FUNCTIONS .IX Header "FUNCTIONS" .SS ripemd128 .IX Subsection "ripemd128" Joins all arguments into a single string and returns its RIPEMD128 digest encoded as a binary string. .PP 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. \f(CW\*(C`undef\*(C'\fR is treated as an empty string and may emit Perl's usual "uninitialized value" warning. The same rules apply to \f(CW\*(C`ripemd128_hex\*(C'\fR, \f(CW\*(C`ripemd128_b64\*(C'\fR, and \&\f(CW\*(C`ripemd128_b64u\*(C'\fR. .PP .Vb 3 \& my $ripemd128_raw = ripemd128(\*(Aqdata string\*(Aq); \& #or \& my $ripemd128_raw = ripemd128(\*(Aqany data\*(Aq, \*(Aqmore data\*(Aq, \*(Aqeven more data\*(Aq); .Ve .SS ripemd128_hex .IX Subsection "ripemd128_hex" Joins all arguments into a single string and returns its RIPEMD128 digest encoded as a hexadecimal string. .PP .Vb 3 \& my $ripemd128_hex = ripemd128_hex(\*(Aqdata string\*(Aq); \& #or \& my $ripemd128_hex = ripemd128_hex(\*(Aqany data\*(Aq, \*(Aqmore data\*(Aq, \*(Aqeven more data\*(Aq); .Ve .SS ripemd128_b64 .IX Subsection "ripemd128_b64" Joins all arguments into a single string and returns its RIPEMD128 digest encoded as a Base64 string, \fBwith\fR trailing '=' padding. .PP .Vb 3 \& my $ripemd128_b64 = ripemd128_b64(\*(Aqdata string\*(Aq); \& #or \& my $ripemd128_b64 = ripemd128_b64(\*(Aqany data\*(Aq, \*(Aqmore data\*(Aq, \*(Aqeven more data\*(Aq); .Ve .SS ripemd128_b64u .IX Subsection "ripemd128_b64u" Joins all arguments into a single string and returns its RIPEMD128 digest encoded as a Base64 URL-safe string (see RFC 4648 section 5). .PP .Vb 3 \& my $ripemd128_b64url = ripemd128_b64u(\*(Aqdata string\*(Aq); \& #or \& my $ripemd128_b64url = ripemd128_b64u(\*(Aqany data\*(Aq, \*(Aqmore data\*(Aq, \*(Aqeven more data\*(Aq); .Ve .SS ripemd128_file .IX Subsection "ripemd128_file" Reads a file given by a filename or filehandle and returns its RIPEMD128 digest encoded as a binary string. .PP .Vb 4 \& my $ripemd128_raw = ripemd128_file(\*(Aqfilename.dat\*(Aq); \& #or \& my $filehandle = ...; # existing binary\-mode filehandle \& my $ripemd128_raw = ripemd128_file($filehandle); .Ve .SS ripemd128_file_hex .IX Subsection "ripemd128_file_hex" Reads a file given by a filename or filehandle and returns its RIPEMD128 digest encoded as a hexadecimal string. .PP .Vb 4 \& my $ripemd128_hex = ripemd128_file_hex(\*(Aqfilename.dat\*(Aq); \& #or \& my $filehandle = ...; # existing binary\-mode filehandle \& my $ripemd128_hex = ripemd128_file_hex($filehandle); .Ve .PP \&\fBNote:\fR The filehandle must be in binary mode before you pass it to \f(CWaddfile()\fR. .SS ripemd128_file_b64 .IX Subsection "ripemd128_file_b64" Reads a file given by a filename or filehandle and returns its RIPEMD128 digest encoded as a Base64 string, \fBwith\fR trailing '=' padding. .PP .Vb 4 \& my $ripemd128_b64 = ripemd128_file_b64(\*(Aqfilename.dat\*(Aq); \& #or \& my $filehandle = ...; # existing binary\-mode filehandle \& my $ripemd128_b64 = ripemd128_file_b64($filehandle); .Ve .SS ripemd128_file_b64u .IX Subsection "ripemd128_file_b64u" Reads a file given by a filename or filehandle and returns its RIPEMD128 digest encoded as a Base64 URL-safe string (see RFC 4648 section 5). .PP .Vb 4 \& my $ripemd128_b64url = ripemd128_file_b64u(\*(Aqfilename.dat\*(Aq); \& #or \& my $filehandle = ...; # existing binary\-mode filehandle \& my $ripemd128_b64url = ripemd128_file_b64u($filehandle); .Ve .SH METHODS .IX Header "METHODS" The OO interface provides the same set of functions as Crypt::Digest. Unless noted otherwise, assume \f(CW$d\fR is an existing digest object created via \&\f(CW\*(C`new\*(C'\fR, for example: .PP .Vb 1 \& my $d = Crypt::Digest::RIPEMD128\->new(); .Ve .SS new .IX Subsection "new" .Vb 1 \& my $d = Crypt::Digest::RIPEMD128\->new(); .Ve .SS clone .IX Subsection "clone" .Vb 1 \& $d\->clone(); .Ve .SS reset .IX Subsection "reset" .Vb 1 \& $d\->reset(); .Ve .SS add .IX Subsection "add" Appends data to the message. Returns the object itself (for chaining). .PP Each argument is converted to bytes using Perl's usual scalar stringification. Defined scalars, including numbers and string-overloaded objects, are accepted. \f(CW\*(C`undef\*(C'\fR is treated as an empty string and may emit Perl's usual "uninitialized value" warning. .PP .Vb 3 \& $d\->add(\*(Aqany data\*(Aq); \& #or \& $d\->add(\*(Aqany data\*(Aq, \*(Aqmore data\*(Aq, \*(Aqeven more data\*(Aq); .Ve .SS addfile .IX Subsection "addfile" Reads the file content and appends it to the message. Returns the object itself (for chaining). .PP .Vb 4 \& $d\->addfile(\*(Aqfilename.dat\*(Aq); \& #or \& my $filehandle = ...; # existing binary\-mode filehandle \& $d\->addfile($filehandle); .Ve .SS hashsize .IX Subsection "hashsize" .Vb 5 \& $d\->hashsize; \& #or \& Crypt::Digest::RIPEMD128\->hashsize(); \& #or \& Crypt::Digest::RIPEMD128::hashsize(); .Ve .SS digest .IX Subsection "digest" Returns the binary digest (raw bytes). The first call finalizes the digest object. Any later \f(CWadd()\fR, \&\f(CWaddfile()\fR, \f(CWdigest()\fR, \f(CWhexdigest()\fR, \f(CWb64digest()\fR, or \&\f(CWb64udigest()\fR call will fail until you call \f(CWreset()\fR. .PP .Vb 1 \& my $result_raw = $d\->digest(); .Ve .SS hexdigest .IX Subsection "hexdigest" Returns the digest encoded as a lowercase hexadecimal string. Like \f(CWdigest()\fR, the first call finalizes the digest object. .PP .Vb 1 \& my $result_hex = $d\->hexdigest(); .Ve .SS b64digest .IX Subsection "b64digest" Returns the digest encoded as a Base64 string with trailing \f(CW\*(C`=\*(C'\fR padding. Like \f(CWdigest()\fR, the first call finalizes the digest object. .PP .Vb 1 \& my $result_b64 = $d\->b64digest(); .Ve .SS b64udigest .IX Subsection "b64udigest" Returns the digest encoded as a Base64 URL-safe string (no trailing \f(CW\*(C`=\*(C'\fR). Like \f(CWdigest()\fR, the first call finalizes the digest object. .PP .Vb 1 \& my $result_b64url = $d\->b64udigest(); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .IP \(bu 4 CryptX, Crypt::Digest .IP \(bu 4