What is Perl's default hash implementation?

by Evan Carroll   Last Updated August 14, 2019 04:26 AM

According to perldoc perlsec

Alternative Hash Functions The source code includes multiple hash algorithms to choose from. While we believe that the default perl hash is robust to attack, we have included the hash function Siphash as a fall-back option. At the time of release of Perl 5.18.0 Siphash is believed to be of cryptographic strength. This is not the default as it is much slower than the default hash.

What is the default perl hash function? From the context we can infer it's not SIPHASH?



Answers 1


From the INSTALL file in the source,

Since Perl 5.18 we have included support for multiple hash functions, although from time to time we change which functions we support, and which function is default (currently SBOX+STADTX on 64 bit builds and SBOX+ZAPHOD32 for 32 bit builds).

You can see that in the source code here

So it seems for 64 bit builds it's StadtX.

Evan Carroll
Evan Carroll
August 14, 2019 04:24 AM

Related Questions


Updated April 06, 2017 01:26 AM

Updated November 25, 2017 21:26 PM

Updated September 06, 2018 21:26 PM

Updated June 09, 2019 05:26 AM

Updated June 06, 2019 05:26 AM