#ifndef HASHFUNCTION01_H
#define HASHFUNCTION01_H

#include <typedefs.h>


/*
\brief  A general hash function found in public domain.
 It can be used for many applications.
 
I no longer have the reference. It is easy to change 
 the numbers if you want your own anyway.
*/
class hashfunction01
{
public:

  /** The number of loops in the hash function. */
  uint nloops;

  /** Construct in bad state. */
  hashfunction01();

  /** Construct class. */
  void construct(uint nloops_)
    { nloops=nloops_; }

  /** Control the number of loops, must be greater 
      than 0.*/
  hashfunction01(uintc nloops_);

  /** Hash an integer to another integer. */
  uintc operator()(uintc key) const;

};


#endif





