OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [software/] [AS64/] [source/] [HTSYMHSH.cpp] - Rev 48

Compare with Previous | Blame | View Log

#include "stdafx.h"
 
SHashVal htSymHash(SHashTbl *hi, char *key)  // (this, key)
{
   SHashVal tmp;
   int len, xx;
 
   len = strlen(key);
   tmp.hash = len;
   for (xx = 0; xx < len; xx++)
   {
      tmp.hash = _rotl(tmp.hash, 2) ^ key[xx];
      tmp.delta = _rotr(tmp.delta, 2) ^ key[xx];
   }
   tmp.hash %= hi->size;
   if (!(tmp.delta %= hi->size))
      tmp.delta = 1;
   return tmp;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.