NAME

Digest::SipHash::PP - Pure-Perl implementation of the SipHash algorithm

VERSION

$Id: PP.pm,v 0.12 2013/02/28 03:18:03 dankogai Exp dankogai $

SYNOPSIS

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
}

DESCRIPTION

This module is identical to Digest::SipHash except implementation. This module is not meant to be practical; written just for the sake of curiosity.

IMPLEMENTATION

For the sake of 32-bit compatibility, this module uses Math::BigInt for 64-bit operations on which SipHash heavily relies.

EXPORT

siphash(), siphash32() and siphash64() on demand.

:all to all of above

SUBROUTINES/METHODS

siphash

siphash32

siphash64

See Digest::SipHash for details.

AUTHOR

Dan Kogai, <dankogai+cpan at gmail.com>

LICENSE AND COPYRIGHT

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