44 #ifndef CCXX_DIGEST_H_
45 #define CCXX_DIGEST_H_
47 #ifndef CCXX_MISSING_H_
51 #ifndef CCXX_THREAD_H_
55 #ifndef CCXX_EXCEPTION_H_
59 #ifdef CCXX_NAMESPACES
80 virtual unsigned getSize(
void) = 0;
88 virtual unsigned getDigest(
unsigned char *buffer) = 0;
96 virtual void putDigest(
const unsigned char *buffer,
unsigned length) = 0;
103 virtual std::ostream &strDigest(std::ostream &os) = 0;
112 virtual void initDigest(
void) = 0;
130 std::ostream &strDigest(std::ostream &os);
141 unsigned getDigest(
unsigned char *buffer);
143 void putDigest(
const unsigned char *buffer,
unsigned length);
160 std::ostream &strDigest(std::ostream &os);
174 {
return sizeof(crc16);};
178 operator const uint16()
const
184 unsigned getDigest (
unsigned char *buffer );
186 void putDigest (
const unsigned char *buffer,
unsigned length );
200 uint32 crc_table[256];
205 unsigned char overflow(
unsigned char octet);
207 std::ostream &strDigest(std::ostream &os);
213 void initDigest(
void);
215 inline unsigned getSize(
void) {
return sizeof(crc32);}
217 operator const uint32()
const
223 unsigned getDigest(
unsigned char *buffer);
225 void putDigest(
const unsigned char *buffer,
unsigned length);
239 unsigned long state[4];
240 unsigned long count[2];
241 unsigned char buf[64];
243 unsigned char md5[16];
253 std::ostream &strDigest(std::ostream &os);
258 void initDigest(
void);
263 unsigned getDigest(
unsigned char *buffer);
265 void putDigest(
const unsigned char *buffer,
unsigned len);
268 #ifdef COMMON_STD_EXCEPTION
278 class __EXPORT DigestException :
public Exception {
280 DigestException(
const String &str) : Exception(str) {};
284 #ifdef CCXX_NAMESPACES
unsigned getSize(void)
Get the size of a digest in octets.
substitute functions which may be missing in target platform libc.
unsigned getSize(void)
Get the size of a digest in octets.
This is a generic and portable string class.
A crc32 collection/computation hash accumulator class.
GNU Common C++ exception model base classes.
Synchronization and threading services.
void initDigest(void)
Reset the digest table to an initial default value.
virtual std::ostream & strDigest(std::ostream &os)=0
print a digest string for export.
A md5 collection/computation accululator class.
A crc16 collection/compution hash accumulator class.
void initDigest(void)
Reset the digest table to an initial default value.
void initDigest(uint16 crc)
unsigned getSize(void)
Get the size of a digest in octets.
friend std::ostream & operator<<(std::ostream &os, Digest &ia)
unsigned getSize(void)
Get the size of a digest in octets.
A simple checksum digest function.
The digest base class is used for implementing and deriving one way hashing functions.