# Poco::Crypto

# class DigestEngine

Library: Crypto
Package: Digest
Header: Poco/Crypto/DigestEngine.h

## Description

This class implements a Poco::DigestEngine for all digest algorithms supported by OpenSSL.

## Inheritance

Direct Base Classes: Poco::DigestEngine

All Base Classes: Poco::DigestEngine

## Member Summary

Member Functions: algorithm, digest, digestLength, nid, reset, updateImpl

Inherited Functions: digest, digestFromHex, digestLength, digestToHex, reset, update, updateImpl

## Constructors

### DigestEngine

DigestEngine(
const std::string & name
);

Creates a DigestEngine using the digest with the given name (e.g., "MD5", "SHA1", "SHA256", "SHA512", etc.). See the OpenSSL documentation for a list of supported digest algorithms.

Throws a Poco::NotFoundException if no algorithm with the given name exists.

## Destructor

### ~DigestEngine

~DigestEngine();

Destroys the DigestEngine.

## Member Functions

### algorithm

const std::string & algorithm() const;

Returns the name of the digest algorithm.

### digest

const Poco::DigestEngine::Digest & digest();

### digestLength

std::size_t digestLength() const;

See also: Poco::DigestEngine::digestLength()

### nid

int nid() const;

Returns the NID (OpenSSL object identifier) of the digest algorithm.

### reset

void reset();

See also: Poco::DigestEngine::reset()

### updateImpl

void updateImpl(
const void * data,
std::size_t length
);

See also: Poco::DigestEngine::updateImpl()