Crypt::...A512_224(3)
π NAME π
Okay so bestie, this is the man page for Crypt::Digest::SHA512_224 β the header up top squishes it down to Crypt::...A512_224(3) but like, we know her π
. She's the hash function SHA-512/224, and yes, [size: 224 bits] β that's the whole vibe. Small output, big energy.
β¨ SYNOPSIS β¨
Two ways to hang out with her: the functional interface (just call functions, no cap) or the OO interface (make an object, be fancy). Both are iconic π.
### Functional interface:
use Crypt::Digest::SHA512_224 qw( sha512_224 sha512_224_hex sha512_224_b64 sha512_224_b64u
sha512_224_file sha512_224_file_hex sha512_224_file_b64 sha512_224_file_b64u );
# calculate digest from string/buffer
my $data = 'data string';
my $sha512_224_raw = sha512_224($data);
my $sha512_224_hex = sha512_224_hex($data);
my $sha512_224_b64 = sha512_224_b64($data);
my $sha512_224_b64u = sha512_224_b64u($data);
# or from file
my $sha512_224_file_raw = sha512_224_file('filename.dat');
my $sha512_224_file_hex = sha512_224_file_hex('filename.dat');
my $sha512_224_file_b64 = sha512_224_file_b64('filename.dat');
my $sha512_224_file_b64u = sha512_224_file_b64u('filename.dat');
# or from filehandle
my $filehandle = ...; # existing binary-mode filehandle
my $sha512_224_fh_raw = sha512_224_file($filehandle);
my $sha512_224_fh_hex = sha512_224_file_hex($filehandle);
my $sha512_224_fh_b64 = sha512_224_file_b64($filehandle);
my $sha512_224_fh_b64u = sha512_224_file_b64u($filehandle);
### OO interface:
use Crypt::Digest::SHA512_224;
my $d = Crypt::Digest::SHA512_224->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::SHA512_224->new->addfile('filename.dat')->digest;
πΈ DESCRIPTION πΈ
She provides an interface to the SHA512_224 digest algorithm. That's the whole tea. Sip it β.
π EXPORT π
Nothing is exported by default. Not a single thing, bestie β you have to ask nicely.
Wanna pick and choose? Export selected functions like this:
use Crypt::Digest::SHA512_224 qw(sha512_224 sha512_224_hex sha512_224_b64 sha512_224_b64u
sha512_224_file sha512_224_file_hex sha512_224_file_b64 sha512_224_file_b64u);
Or just take the whole squad at once:
use Crypt::Digest::SHA512_224 ':all';
π¦ FUNCTIONS π¦
sha512_224
Joins all the arguments into one single string and hands you its SHA512_224 digest, encoded as a binary string. Raw bytes, no filter π.
About the data arguments for the functional helpers: they get converted to byte strings using Perl's usual scalar stringification. Defined scalars are accepted β numbers included, and string-overloaded objects too. undef is treated as an empty string and may emit Perl's usual uninitialized value warning (you've been warned, it's giving classic Perl π). The exact same rules apply to sha512_224_hex, sha512_224_b64, and sha512_224_b64u.
my $sha512_224_raw = sha512_224('data string');
#or
my $sha512_224_raw = sha512_224('any data', 'more data', 'even more data');
sha512_224_hex
Joins all the arguments into one string and returns its SHA512_224 digest encoded as a hexadecimal string. Very readable, very demure.
my $sha512_224_hex = sha512_224_hex('data string');
#or
my $sha512_224_hex = sha512_224_hex('any data', 'more data', 'even more data');
sha512_224_b64
Joins all the arguments into one string and returns its SHA512_224 digest encoded as a Base64 string, trailing '=' padding included β she does not skip the padding, periodt.
my $sha512_224_b64 = sha512_224_b64('data string');
#or
my $sha512_224_b64 = sha512_224_b64('any data', 'more data', 'even more data');
sha512_224_b64u
Joins all the arguments into one string and returns its SHA512_224 digest encoded as a Base64 URL-safe string (see RFC 4648 section 5). URL-safe is the moment, honestly π₯.
my $sha512_224_b64url = sha512_224_b64u('data string');
#or
my $sha512_224_b64url = sha512_224_b64u('any data', 'more data', 'even more data');
sha512_224_file
Reads a file β give her a filename or a filehandle β and returns its SHA512_224 digest encoded as a binary string.
my $sha512_224_raw = sha512_224_file('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $sha512_224_raw = sha512_224_file($filehandle);
sha512_224_file_hex
Reads a file β filename or filehandle, your call β and returns its SHA512_224 digest encoded as a hexadecimal string.
my $sha512_224_hex = sha512_224_file_hex('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $sha512_224_hex = sha512_224_file_hex($filehandle);
Note: The filehandle must be in binary mode before you pass it to addfile(). Do not come for me on this one, it's literally in the docs π«Ά.
sha512_224_file_b64
Reads a file β filename or filehandle β and returns its SHA512_224 digest encoded as a Base64 string, with trailing '=' padding.
my $sha512_224_b64 = sha512_224_file_b64('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $sha512_224_b64 = sha512_224_file_b64($filehandle);
sha512_224_file_b64u
Reads a file β filename or filehandle β and returns its SHA512_224 digest encoded as a Base64 URL-safe string (see RFC 4648 section 5).
my $sha512_224_b64url = sha512_224_file_b64u('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
my $sha512_224_b64url = sha512_224_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, like:
my $d = Crypt::Digest::SHA512_224->new();
new
Makes a brand new digest object. Main character energy from the jump β.
my $d = Crypt::Digest::SHA512_224->new();
clone
Copies your digest object so you can keep the vibe going in two directions at once π§.
$d->clone();
reset
Wipes her back to a clean slate. Fresh start, no baggage π .
$d->reset();
add
Appends data to the message. Returns the object itself β so you can chain, and chaining is lowkey the best part.
Each argument is converted to bytes using Perl's usual scalar stringification. Defined scalars are accepted, numbers and string-overloaded objects included. 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, we love to see it).
$d->addfile('filename.dat');
#or
my $filehandle = ...; # existing binary-mode filehandle
$d->addfile($filehandle);
hashsize
Tells you the hash size. Three whole ways to ask, because options are a personality π.
$d->hashsize;
#or
Crypt::Digest::SHA512_224->hashsize();
#or
Crypt::Digest::SHA512_224::hashsize();
digest
Returns the binary digest β raw bytes, straight up.
β οΈ The first call finalizes the digest object. Any lateradd(),addfile(),digest(),hexdigest(),b64digest(), orb64udigest()call will fail until you callreset(). She's done after one digest, bestie. That's her boundary π.
my $result_raw = $d->digest();
hexdigest
Returns the digest encoded as a lowercase hexadecimal string. Like digest(), the first call finalizes the digest object β same rule, same drama.
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 "=", she's sleek like that. Like digest(), the first call finalizes the digest object.
my $result_b64url = $d->b64udigest();
π SEE ALSO π
CryptX,Crypt::Digest- <https://en.wikipedia.org/wiki/SHA-2>
And that's the whole page, bestie π«Άβ¨. Shoutout to perl v5.42.0, dated 2026-05-11 β that's the source/version and date straight off the footer, so you know exactly which era of slay you're reading ππ.
π¦ 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