File: cmd5.h

package info (click to toggle)
postal 0.62.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 476 kB
  • ctags: 445
  • sloc: cpp: 2,902; sh: 289; ansic: 258; makefile: 86
file content (38 lines) | stat: -rw-r--r-- 512 bytes parent folder | download
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
38
#ifndef CMD5_H
#define CMD5_H

extern "C"
{
#ifdef USE_SSL
#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