Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » New hash folding function...
Re: New hash folding function... [message #13686 is a reply to message #13684] Tue, 22 January 2008 08:55 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
Your new hash-fold function seems similar to the last step of that hash function on Wikipedia

hash += (hash << 3);
hash ^= (hash >> 11);
hash += (hash << 15);

Is this a standard type of thing to do after the byte-by-byte bit even when you're not saving the pre-masked result. Is there a mathematical basis for this "extra" bit (like CRC) or was it just found by trial and error?

Why do you call it "hash-fold" if it doesn't actually reduce the range of values
- or if
return (h >> 23) - (h >> 9) - (h >> 15) - h;
does reduce the range of values, how does it do that, since it's unsigned arithmetic?

Graeme
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: RMI
Next Topic: Code reformatting
Goto Forum:
  


Current Time: Thu Jun 26 21:10:13 CEST 2025

Total time taken to generate the page: 0.04238 seconds