---
name: "Digest"
section: "3cc"
platform: "linux"
package: "libcommoncpp2-dev"
version: "1.0.13-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/Digest"
---

# Digest(3cc)

The digest base class is used for implementing and deriving one way hashing functions. base class for hashing services.

## NAME

Digest - The digest base class is used for implementing and deriving one way hashing functions. base class for hashing services.

## SYNOPSIS

`#include <digest.h>`

Inherited by **ChecksumDigest**, **CRC16Digest**, **CRC32Digest**, **MD5Digest**, **SHADigest\< uint\_type, blockSizeInBytes \>**, and **SHADigest\< uint64, 64 \>**.

### Protected Methods

**Digest** ()\
 virtual void **initDigest** (void)=0\
 *Reset the digest table to an initial default value.* virtual unsigned **getSize** (void)=0\
 *Get the size of a digest in octets.* virtual unsigned **getDigest** (unsigned char \*buffer)=0\
 *Copy the binary digest buffer to user memory.* virtual void **putDigest** (const unsigned char \*buffer, unsigned length)=0\
 *Put data into the digest bypassing the stream subsystem.* virtual std::ostream & **strDigest** (std::ostream &os)=0\
 *print a digest string for export.*

### Friends

std::ostream & **operator\<\<** (std::ostream &os, Digest &ia)\

## DETAILED DESCRIPTION

The digest base class is used for implementing and deriving one way hashing functions. base class for hashing services.

**Author:**  David Sugar \<dyfet@ostel.com\>

## CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

### Digest::Digest ()` [protected]`

## MEMBER FUNCTION DOCUMENTATION

### virtual unsigned Digest::getDigest (unsigned char \* buffer)` [protected, pure virtual]`

Copy the binary digest buffer to user memory.

**Returns:**  number of bytes in digest.

**Parameters:**

- *buffer*

  *to write into.*

*Implemented in* **ChecksumDigest***,* **CRC16Digest***,* **CRC32Digest***,* **MD5Digest***, and* **SHA64DigestHelper***.*

### virtual unsigned Digest::getSize (void)` [protected, pure virtual]`

*Get the size of a digest in octets.*

**Returns:**  *number of bytes in digest.*

*Implemented in* **ChecksumDigest***,* **CRC16Digest***,* **CRC32Digest***,* **MD5Digest***,* **SHADigest\< uint\_type, blockSizeInBytes \>***,* **SHA1Digest***,* **SHA256Digest***, and* **SHADigest\< uint64, 64 \>***.*

### virtual void Digest::initDigest (void)` [protected, pure virtual]`

*Reset the digest table to an initial default value.*

*Implemented in* **ChecksumDigest***,* **CRC16Digest***,* **CRC32Digest***,* **MD5Digest***,* **SHADigest\< uint\_type, blockSizeInBytes \>***,* **SHA1Digest***,* **SHA256Digest***, and* **SHADigest\< uint64, 64 \>***.*

### virtual void Digest::putDigest (const unsigned char \* buffer, unsigned length)` [protected, pure virtual]`

*Put data into the digest bypassing the stream subsystem.*

**Parameters:**

- *buffer*

  *to read from.*

- *length*

  *of data.*

*Implemented in* **ChecksumDigest***,* **CRC16Digest***,* **CRC32Digest***,* **MD5Digest***,* **SHADigest\< uint\_type, blockSizeInBytes \>***, and* **SHADigest\< uint64, 64 \>***.*

### virtual std::ostream& Digest::strDigest (std::ostream & os)` [protected, pure virtual]`

*print a digest string for export.*

**Returns:**  *string representation of digest.*

*Implemented in* **ChecksumDigest***,* **CRC16Digest***,* **CRC32Digest***,* **MD5Digest***,* **SHADigest\< uint\_type, blockSizeInBytes \>***,* **SHA64DigestHelper***, and* **SHADigest\< uint64, 64 \>***.*

## FRIENDS AND RELATED FUNCTION DOCUMENTATION

### std::ostream& operator\<\< (std::ostream & os, Digest & ia)` [friend]`

## AUTHOR

*Generated automatically by Doxygen for CommonC++ from the source code.*
