class Poco::SHA1Engine
Overview
This class implementes the SHA-1 message digest algorithm. Moreā¦
#include <SHA1Engine.h> class SHA1Engine: public Poco::DigestEngine { public: // enums enum { BLOCK_SIZE = 64, DIGEST_SIZE = 20, }; // structs struct Context; // methods virtual std::size_t digestLength() const; virtual void reset(); virtual const DigestEngine::Digest& digest(); protected: // methods virtual void updateImpl( const void* data, std::size_t length ); };
Inherited Members
public: // typedefs typedef std::vector<unsigned char> Digest; // methods void update( const void* data, std::size_t length ); void update(char data); void update(const std::string& data); virtual std::size_t digestLength() const = 0; virtual void reset() = 0; virtual const Digest& digest() = 0; static std::string digestToHex(const Digest& bytes); static Digest digestFromHex(const std::string& digest); protected: // methods virtual void updateImpl( const void* data, std::size_t length ) = 0;
Detailed Documentation
This class implementes the SHA-1 message digest algorithm.
(FIPS 180-1, see http://www.itl.nist.gov/fipspubs/fip180-1.htm)
Methods
virtual std::size_t digestLength() const
Returns the length of the digest in bytes.
virtual void reset()
Resets the engine so that a new digest can be computed.
virtual const DigestEngine::Digest& digest()
Finishes the computation of the digest and returns the message digest.
Resets the engine and can thus only be called once for every digest. The returned reference is valid until the next time digest() is called, or the engine object is destroyed.
virtual void updateImpl( const void* data, std::size_t length )
Updates the digest with the given data.
Must be implemented by subclasses.