Digest::SipHash::PP - Pure-Perl implementation of the SipHash algorithm
$Id: PP.pm,v 0.10 2013/02/18 10:43:55 dankogai Exp dankogai $
use Digest::SipHash::PP qw/siphash/; my $seed = pack 'C16', 0 .. 0xF; # 16 chars long my $str = "hello world!"; my ( $lo, $hi ) = siphash( $str, $seed ); # $lo = 0x10cf32e0, $hi == 0x7da9cd17 my $u32 = siphash( $str, $seed ) # $u32 = 0x10cf32e0 use Config; if ( $Config{use64bitint} ) { use Digest::SipHash qw/siphash64/; my $uint64 = siphash64( $str, $seed ); # scalar context; # $uint64 == 0x7da9cd1710cf32e0 }
This module is identical to Digest::SipHash except implementation. This module is not meant to be practical; written just for the sake of curiosity.
For the sake of 32-bit compatibility, this module uses Math::BigInt for 64-bit operations on which SipHash heavily relies.
siphash(), siphash32() and siphash64() on demand.
siphash()
siphash32()
siphash64()
:all to all of above
:all
See Digest::SipHash for details.
Dan Kogai, <dankogai+cpan at gmail.com>
<dankogai+cpan at gmail.com>
Copyright 2013 Dan Kogai.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
To install Digest::SipHash, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Digest::SipHash
CPAN shell
perl -MCPAN -e shell install Digest::SipHash
For more information on module installation, please visit the detailed CPAN module installation guide.