in reply to 32bit/64bit hash function: Use perls internal hash function?
To answer your question directly, PERL_HASH is exposed by B:
$ perl -MB=hash -le 'print hash("foo")' 0xad6987c4 $ perl -MB=hash -le 'print hash("foo")' 0x5fd458f7
But as I said, you may want to consider using a standardized function, which when implemented in XS should be "nearly as fast". Also, keep in mind that in hashes, collisions are acceptable - short checksums will do that, and since you haven't told us anything about the problem you're trying to solve, we can't know if that is appropriate in your case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 32bit/64bit hash function: Use perls internal hash function?
by sectokia (Friar) on Apr 10, 2022 at 10:59 UTC | |
by haukex (Archbishop) on Apr 10, 2022 at 11:33 UTC | |
|
Re^2: 32bit/64bit hash function: Use perls internal hash function?
by sectokia (Friar) on Apr 10, 2022 at 12:49 UTC | |
by vr (Curate) on Apr 11, 2022 at 12:20 UTC |