hash.cpp File Reference


Detailed Description

Implementation of Hash classes.

Definition in file hash.cpp.

#include <hn/hnprec.h>
#include <hn/hash.h>

Include dependency graph for hash.cpp:

Go to the source code of this file.


Namespaces

namespace  CGComm

Functions

HashBaseloadHash (std::istream &i)
 Load a hash from stream.
void invalidType (uint8_t x, uint8_t y)
HashSetBaseloadHashSet (std::istream &i)
 Load HashSet from stream.
std::ostream & operator<< (std::ostream &o, const HashBase &h)
std::ostream & operator<< (std::ostream &o, const HashSetBase &h)
 Output operator for streams.

Function Documentation

void invalidType uint8_t  x,
uint8_t  y
[inline]
 

Definition at line 47 of file hash.cpp.

References Utils::hexDump().

Referenced by CGComm::loadHashSet().

Here is the call graph for this function:

HashBase * CGComm::loadHash std::istream &  i  ) 
 

Load a hash from stream.

Definition at line 26 of file hash.cpp.

References CGComm::OP_HT_ED2K, CGComm::OP_HT_MD4, CGComm::OP_HT_MD5, and CGComm::OP_HT_SHA1.

HashSetBase * CGComm::loadHashSet std::istream &  i  ) 
 

Load HashSet from stream.

Todo:
This must be one the ugliest constructs I'v ever seen ... it _probably_ could be done in a much nicer way than nested duplicating switch statements...

Definition at line 60 of file hash.cpp.

References CGComm::invalidType(), logTrace(), CGComm::OP_HT_ED2K, CGComm::OP_HT_MD4, CGComm::OP_HT_MD5, CGComm::OP_HT_SHA1, and TRACE_HASH.

Referenced by MetaData::MetaData().

Here is the call graph for this function:

std::ostream& operator<< std::ostream &  o,
const HashSetBase h
 

Output operator for streams.

<uint8>OP_HASHSET<uint16>objlength<uint8>filehashtype<uint8>parthashtype <uint16>tagcount[<tagcount>*Tag]

Definition at line 158 of file hash.cpp.

References HashSetBase::getFileHash(), CGComm::OP_HASHSET, CGComm::OP_HS_FILEHASH, CGComm::OP_HS_PARTHASH, CGComm::OP_HS_PARTSIZE, and Utils::putVal().

Here is the call graph for this function:

std::ostream& operator<< std::ostream &  o,
const HashBase h
 

Definition at line 144 of file hash.cpp.

References CGComm::OP_HASH, and Utils::putVal().

Here is the call graph for this function: