]> git.tdb.fi Git - libs/crypto.git/blob - source/hash.h
Implement the SHA2 hash family
[libs/crypto.git] / source / hash.h
1 #ifndef MSP_CRYPTO_HASH_H_
2 #define MSP_CRYPTO_HASH_H_
3
4 #include <string>
5
6 namespace Msp {
7 namespace Crypto {
8
9 class Hash
10 {
11 protected:
12         Hash() { }
13 public:
14         virtual ~Hash() { }
15
16         virtual unsigned get_digest_size() const = 0;
17
18         virtual void update(const char *, unsigned) = 0;
19         virtual void update(const std::string &);
20         virtual unsigned get_digest(char *, unsigned) const = 0;
21         virtual std::string get_hexdigest() const;
22 };
23
24 } // namespace Crypto
25 } // namespace Msp
26
27 #endif