Digest::MurmurHash3 - MurmurHash3 Implementation For Perl
use Digest::MurmurHash3 qw( murmur32 ); # on 64 bit platforms, defaults to x64. otherwise x86 # note that the values for each platform *WILL DIFFER* use Digest::MurmurHash3 qw( murmur128 ); # If you want to explicitly require one algorithm, you need # to be specific use Digest::MurmurHash3 qw( murmur128_x64 ); use Digest::MurmurHash3 qw( murmur128_x86 ); my $hash = murmur32( $data_to_hash ); # Create four 8 bit pieces my ($v1, $v2, $v3, $v4) = murmur128_x86( $data_to_hash ); # Create two 64 bit pieces (your perl must be built to use 64bit ints) my ($v1, $v2) = murmur128_x64( $data_to_hash );
This module provides an interface to MurmurHash3 functions.
Calculates a 32 bit hash.
Calculates a 128 bit hash.
Note that the actual implementation of this function will differ depending on how your perl was built.
If your perl was built with 64 bit integers, this function is an alias to mumur128_x64(). Otherwise, it's an alias to mumur128_x68(). While they employ similar calculations, each use the best approach for your system so the results are different. The x64 version returns two element list of 64 bit integers. The x86 version returns a four element list of 32 bit integers.
Calculates a 128 bit hash. The result is returned as a four element list of 32 bit integers
Calculates a 128 bit hash. The result is returned as a two element list of 64 bit integers
Daisuke Maki <daisuke@endeworks.jp>
<daisuke@endeworks.jp>
MurmurHash3 by Austin Appleby.
To install Digest::MurmurHash3, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Digest::MurmurHash3
CPAN shell
perl -MCPAN -e shell install Digest::MurmurHash3
For more information on module installation, please visit the detailed CPAN module installation guide.