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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [software/] [AS64/] [source/] [HTSYMHSH.cpp] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 robfinch
#include "stdafx.h"
2
 
3
SHashVal htSymHash(SHashTbl *hi, char *key)  // (this, key)
4
{
5
   SHashVal tmp;
6
   int len, xx;
7
 
8
   len = strlen(key);
9
   tmp.hash = len;
10
   for (xx = 0; xx < len; xx++)
11
   {
12
      tmp.hash = _rotl(tmp.hash, 2) ^ key[xx];
13
      tmp.delta = _rotr(tmp.delta, 2) ^ key[xx];
14
   }
15
   tmp.hash %= hi->size;
16
   if (!(tmp.delta %= hi->size))
17
      tmp.delta = 1;
18
   return tmp;
19
}

powered by: WebSVN 2.1.0

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