NAME

String::CityHash - CityHash wrapper for Perl

VERSION

version 0.02

SYNOPSIS

use String::CityHash qw(cityhash64);

my $str = "Some string to be hashed";

my $seed0 = 0x9ae16a3b2f90404f;
my $seed1 = 0xc3a5c85c97cb3130;

my $hash1 = cityhash64($str);
my $hash2 = cityhash64($str, $seed0);
my $hash3 = cityhash64($str, $seed0, $seed1);

my $hash4 = cityhash128($str);

DESCRIPTION

CityHash is a family of non-cryptographic hash functions for strings. It provides hash functions designed for fast hashing of strings. The functions mix the input bits thoroughly but are not suitable for cryptography.

CityHash is intended to be fast, under the constraint that it hash very well.

EXPORTS

This module exports the subroutines cityhash64 and cityhash128 on request.

SUBROUTINES

cityhash64( $data [, $seed0 [, $seed1 ] ] )

Generate a 64-bit hash for the given data. The optional one or two 64-bit seeds are also hashed into the result.

cityhash128( $data )

Generate a 128-bit hash for the given data.

AUTHOR

Alessandro Ghedini <alexbio@cpan.org>

SEE ALSO

CityHash

LICENSE AND COPYRIGHT

Copyright 2011 Alessandro Ghedini.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.