# perldoc > Crypt::Digest::Keccak224

---
type: CommandReference
command: Crypt::Digest::Keccak224
mode: perldoc
section: 
source: perldoc
---

## Quick Reference
- `keccak224('data')` — raw binary digest
- `keccak224_hex('data')` — hexadecimal digest
- `keccak224_file('file.dat')` — digest of file contents (raw)
- `my $d = Crypt::Digest::Keccak224->new; $d->add('data'); $d->digest;` — OO digest
- `$d->hexdigest` — hexadecimal output from OO interface
- `$d->b64digest` — Base64 output from OO interface

## Name
Hash function Keccak-224 (size: 224 bits)

## Synopsis
perl
# Functional interface
use Crypt::Digest::Keccak224 qw(keccak224 keccak224_hex keccak224_b64 keccak224_b64u
                                keccak224_file keccak224_file_hex keccak224_file_b64 keccak224_file_b64u);

$raw  = keccak224('data string');
# or multiple arguments joined automatically
$raw  = keccak224('data', 'more data');

$hex  = keccak224_hex('data string');
$b64  = keccak224_b64('data string');
$b64u = keccak224_b64u('data string');

# from file (filename or filehandle in binary mode)
$raw  = keccak224_file('filename.dat');
$raw  = keccak224_file(*FH);

# OO interface
$d = Crypt::Digest::Keccak224->new;
$d->add('data');
$d->addfile('filename.dat');
$result_raw  = $d->digest;
$result_hex  = $d->hexdigest;
$result_b64  = $d->b64digest;
$result_b64u = $d->b64udigest;
## Functions & Methods
### Functional interface
- `keccak224(@data)` — returns binary digest (raw bytes)
- `keccak224_hex(@data)` — returns hexadecimal digest
- `keccak224_b64(@data)` — returns Base64 digest (with padding)
- `keccak224_b64u(@data)` — returns Base64 URL-safe digest (RFC 4648 section 5)
- `keccak224_file($filename_or_fh)` — binary digest of file contents
- `keccak224_file_hex($filename_or_fh)` — hex digest of file contents
- `keccak224_file_b64($filename_or_fh)` — Base64 digest of file contents
- `keccak224_file_b64u($filename_or_fh)` — Base64 URL-safe digest of file contents

All functional routines join arguments into a single string. File functions accept a filename or a filehandle (must be in binary mode).

### Object-Oriented methods
- `new()` — constructor
- `clone()` — returns a copy
- `reset()` — reinitializes the object
- `add(@data)` — processes data (multiple arguments joined)
- `addfile($filename_or_fh)` — processes file contents
- `add_bits($bitstring)` or `add_bits($data, $nbits)` — processes bits
- `hashsize()` — returns digest size (224 bits / 28 bytes)
- `digest()` — returns binary digest
- `hexdigest()` — returns hex digest
- `b64digest()` — returns Base64 digest (padded)
- `b64udigest()` — returns Base64 URL-safe digest

## See Also
- [CryptX](https://www.chedong.com/phpMan.php/perldoc/CryptX)
- [Crypt::Digest](https://www.chedong.com/phpMan.php/perldoc/Crypt%3A%3ADigest)
- [Keccak team](https://keccak.team/index.html)