Help for this page

Select Code to Download


  1. or download this
    unsigned int hash = 0;
    while (*s)
       hash = hash * 33 + *s++;
    
  2. or download this
    /* MT_gen_hash_bits()
     *   Dan Bernstein's hash function - works great for short ASCII strin
    +gs!
    ...
      address = address + (address << 31);
      return (unsigned int)address;
    }