hash.h File Reference

Detailed Description

Interface for Hash<>, HashSet<> and their base classes.

Definition in file hash.h.

#include <hn/utils.h>
#include <hn/log.h>
#include <hn/osdep.h>
#include <stdexcept>
#include <iosfwd>
#include <string>
#include <vector>

Include dependency graph for hash.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


namespace  CGComm


enum  HashTypeId {
  OP_HASH = 0xa0, OP_HT_ADLER = 0xa1, OP_HT_CRC32 = 0xa2, OP_HT_ED2K = 0xa3,
  OP_HT_MD4 = 0xa4, OP_HT_MD5 = 0xa5, OP_HT_PANAMA = 0xa6, OP_HT_RIPEMD160 = 0xa7,
  OP_HT_SHA1 = 0xa8, OP_HT_SHA256 = 0xa9, OP_HT_SHA384 = 0xaa, OP_HT_SHA512 = 0xab,
  OP_HT_TIGER = 0xac, OP_HT_UUHASH = 0xad, OP_HT_UNKNOWN = 0xff
 Hash types and the relevant op codes. More...
enum  HashSetTypeIds { OP_HASHSET = 0xc0, OP_HS_FILEHASH = 0xc1, OP_HS_PARTHASH = 0xc2, OP_HS_PARTSIZE = 0xc3 }

Typedef Documentation

typedef HashSet<MD4Hash, ED2KHash, ED2K_PARTSIZE> ED2KHashSet

Definition at line 561 of file hash.h.

Enumeration Type Documentation

enum Hash_Constants

Enumeration values:
ED2K_PARTSIZE  Size of a single file chunk as used in ED2K network.

One chunk-hash corresponds to each ED2K_PARTSIZE amount of file data. Only full chunks of this size may be shared.

Definition at line 553 of file hash.h.

enum HashSetTypeIds

Enumeration values:
OP_HASHSET  Hashset.
OP_HS_FILEHASH  <hash>filehash
OP_HS_PARTHASH  <hash>chunkhash
OP_HS_PARTSIZE  <uint32_t>chunksize

Definition at line 287 of file hash.h.

enum HashTypeId

Hash types and the relevant op codes.

Enumeration values:
OP_HASH  Hash object.
OP_HT_ADLER  length = 4
OP_HT_CRC32  length = 4
OP_HT_ED2K  length = 16
OP_HT_MD4  length = 16
OP_HT_MD5  length = 20
OP_HT_PANAMA  length = 32
OP_HT_RIPEMD160  length = 20
OP_HT_SHA1  length = 20
OP_HT_SHA256  length = 32
OP_HT_SHA384  length = 48
OP_HT_SHA512  length = 64
OP_HT_TIGER  length = 24
OP_HT_UUHASH  length = ??
OP_HT_UNKNOWN  unknown/userdefined/invalid

Definition at line 76 of file hash.h.