Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

more::math::hash Class Template Reference

A hash of minimum Width number of bits. More...

#include <more/math/hash.h>

List of all members.

Public Types

Public Methods

Static Public Attributes


Detailed Description

template<unsigned int Width>
class more::math::hash< Width >

A hash of minimum Width number of bits.

The implemented values for Width at the moment are 96 and 192, other values will be eigther truncated or non-truncated versions of an implementation with more bits. Width > 192 gives compile-time error. I believe this hash function is rather good, but DON'T USE IT FOR SECURITY without checking it, I take no responsibility! It is used by the lang module to create unique file names.


Member Typedef Documentation

template<unsigned int Width>
typedef base::word_const_iterator more::math::hash::word_const_iterator
 

template<unsigned int Width>
typedef base::word_iterator more::math::hash::word_iterator
 

template<unsigned int Width>
typedef base::word_type more::math::hash::word_type
 


Constructor & Destructor Documentation

template<unsigned int Width>
more::math::hash< Width >::hash   [inline]
 

Trivial constructor.

template<unsigned int Width>
more::math::hash< Width >::hash word_type    x [inline]
 

Construct a hash with the given start value (seed).


Member Function Documentation

template<unsigned int Width>
void more::math::hash< Width >::assign_from_c_name char const *    s [inline]
 

Initializes the hash from a name written by strncpy_c_name.

The hash will compare equal to the original, but if this is a truncated hash type (cf the Width template argument), the hashes will develop differtly on further insertions.

template<unsigned int Width>
template<typename T>
void more::math::hash< Width >::insert T const &    x [inline]
 

Chop an arithmetic value into the hash.

template<unsigned int Width>
template<typename T>
void more::math::hash< Width >::insert T const *    it,
T const *    it_end
[inline]
 

Chop a sequence of arithmetic values into the hash.

This is equivalent to inserting each value separately in the same order.

template<unsigned int Width>
void more::math::hash< Width >::strncpy_to_c_name char *    s const [inline]
 

Writes c_name_strlen alphanumeric ascii characters to s, starting with an alphabetic.

The result is not 0-terminated.

template<unsigned int Width>
void more::math::hash< Width >::sync io::syncstream   sio [inline]
 


Member Data Documentation

template<unsigned int Width>
std::size_t const more::math::hash::c_name_strlen = (word_width == 64? word_count*11 : word_count*word_size/2*3) [static]
 

template<unsigned int Width>
std::size_t const more::math::hash::width = word_count*word_width [static]
 

template<unsigned int Width>
std::size_t const more::math::hash::word_count = base::word_count [static]
 

template<unsigned int Width>
std::size_t const more::math::hash::word_size = word_width/8 [static]
 

template<unsigned int Width>
std::size_t const more::math::hash::word_width = base::word_width [static]
 


The documentation for this class was generated from the following file:
Generated on Sat Sep 7 19:12:56 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.