/***************************************************************************
                          HashCode.cpp  -  description
                             -------------------
    begin                : Tue May 22 2001
    copyright            : (C) 2001 by Sven Reichard
    email                : reichard@math.udel.edu
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/



# include "TranspositionTable/HashCode.h"
# include <stdlib.h>
# include <iostream>
using namespace Alice;
HashCode::HashCode(short int primaryBits):
  mPrimary((int) ((1.0*(1<<primaryBits))*rand()/(RAND_MAX+1.0))),
  mSecondary(rand())
{
  mSecondary <<= 32;
  mSecondary |= rand();
};

unsigned long
HashCode::primary() const
{
  return mPrimary;
};

const uint64&
HashCode::secondary() const
{
  return mSecondary;
};
