File: cmd5.h

package info (click to toggle)
postal 0.70
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 540 kB
  • ctags: 525
  • sloc: cpp: 4,131; sh: 289; ansic: 258; makefile: 134
file content (37 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef CMD5_H
#define CMD5_H

extern "C"
{
#ifdef USE_OPENSSL
#include <openssl/md5.h>
#else
#include "md5.h"
#endif
}

using namespace std;
#include <string>

class Cmd5
{
public:
  Cmd5();

  void init();

  // get the sum as a 16byte buffer
  void getSum(char *buf);
  // get the sum into a string reference
  string getSum();

  // add some more data to the data that has been summed.
  void addData(const char *buf, size_t bytes);
  void addData(const string &buf);

private:
  MD5_CTX m_context;
};

#endif