Digest< N > Struct Template Reference

Template message digest class represting a digest with N bytes. More...

#include <Image/Hash.H>

List of all members.

Public Member Functions

bool operator< (const Digest< N > &other) const
 Comparison operator for sorting e.g. in std::set or std::map.
std::string asString () const
 Return a string with N*2 hexadecimal chars representing the digest.
Image< byteasImage () const
 Return an Nx1 Image containing the digest.

Static Public Member Functions

static Digest< N > asDigest (const byte *d, const unsigned int len)
 Pseudo-constructor to create a digest from a byte array.
static Digest< N > fromString (const std::string &s)
 Generate a digest by parsing hex digits from a string.

Public Attributes

byte buffer [N]

Detailed Description

template<unsigned int N>
struct Digest< N >

Template message digest class represting a digest with N bytes.

Definition at line 57 of file Hash.H.


Member Function Documentation

template<unsigned int N>
static Digest<N> Digest< N >::asDigest ( const byte d,
const unsigned int  len 
) [inline, static]

Pseudo-constructor to create a digest from a byte array.

NOTE! This is NOT a message digest OF the byte array; rather we interpreting the bytes in the array as a message digest itself. This might be the case if e.g. a bunch of message digests have been saved to disk as byte images.

Definition at line 95 of file Hash.H.

template<unsigned int N>
Image<byte> Digest< N >::asImage (  )  const [inline]

Return an Nx1 Image containing the digest.

Definition at line 87 of file Hash.H.

template<unsigned int N>
std::string Digest< N >::asString (  )  const [inline]

Return a string with N*2 hexadecimal chars representing the digest.

Definition at line 83 of file Hash.H.

template<unsigned int N>
static Digest<N> Digest< N >::fromString ( const std::string s  )  [inline, static]

Generate a digest by parsing hex digits from a string.

Parameters:
s digest string must have exactly 2*N characters, each of which must be a valid hex digit (0-9, a-f, A-F)

Definition at line 111 of file Hash.H.

template<unsigned int N>
bool Digest< N >::operator< ( const Digest< N > &  other  )  const [inline]

Comparison operator for sorting e.g. in std::set or std::map.

Definition at line 62 of file Hash.H.


The documentation for this struct was generated from the following file:
Generated on Sun May 8 08:21:15 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3