Hi. I manage ASSP (assp.sf.net), a gpl spam filter entirely in perl. I'm looking for a pure perl string hashing subroutine that is as fast as possible with decent hash distribution. Pass a string in and get a 32bit int back. No need for cryptographic security. No need for the same results on different operating systems.
I've thought of unpacking the string as 32bit uints and xor-ing them. That would be fast, but i'm not sure it has ideal distribution over the solution space.
Perl has it's own string hasher built in -- is there an under-the-hood way to get it to process my strings and get ints out? That should be fast and work cross platform.
Or what's your favorite 32bit hash algorythm?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||