Bump version and update Changes
[digest-highwayhash.git] / lib / Digest / HighwayHash.pm
CommitLineData
096619f2
MG
1package Digest::HighwayHash;
2
3use 5.014000;
4use strict;
5use warnings;
6use parent qw/Exporter/;
7
8our @EXPORT_OK = qw/highway_hash64 highway_hash128 highway_hash256/;
9our @EXPORT = @EXPORT_OK;
10
e83a532b 11our $VERSION = '0.001';
096619f2
MG
12
13use Math::Int64;
14
15require XSLoader;
16XSLoader::load('Digest::HighwayHash', $VERSION);
17
181;
19__END__
20
21=encoding utf-8
22
23=head1 NAME
24
fc185944 25Digest::HighwayHash - XS fast strong keyed hash function
096619f2
MG
26
27=head1 SYNOPSIS
28
29 use Digest::HighwayHash;
30 say highway_hash64 [1, 2, 3, 4], 'hello';
31 # 11956820856122239241
32 say join ' ', @{highway_hash128([1, 2, 3, 4], 'hello')};
33 # 3048112761216189476 13900443277579286659
34 say join ' ', @{highway_hash256([1, 2, 3, 4], 'hello')};
35 # 8099666330974151427 17027479935588128037 4015249936799013189 10027181291351549853
36
37=head1 DESCRIPTION
38
fc185944 39HighwayHash is a fast and strong keyed hash function, documented at
096619f2
MG
40L<https://github.com/google/highwayhash>.
41
fc185944
MG
42Three functions are exported by this module, all by default:
43
44=over
45
46=item B<highway_hash64> I<\@key>, I<$input>
47
48Compute the 64-bit HighwayHash of I<$input>, using I<\@key> as a key.
49The key must be a 4-element arrayref, with each element either a
50number or (on Perls without 64-bit numbers) a L<Math::Int64> object. The result is a single number or (on Perls without 64-bit numbers) a L<Math::Int64> object.
51
52=item B<highway_hash128> I<\@key>, I<$input>
53
54Compute the 128-bit HighwayHash of I<$input>, using I<\@key> as a key.
55The key must be a 4-element arrayref, with each element either a
56number or (on Perls without 64-bit numbers) a L<Math::Int64> object. The result is an array of exactly two numbers or (on Perls without 64-bit numbers) L<Math::Int64> objects.
57
58=item B<highway_hash256> I<\@key>, I<$input>
59
60Compute the 256-bit HighwayHash of I<$input>, using I<\@key> as a key.
61The key must be a 4-element arrayref, with each element either a
62number or (on Perls without 64-bit numbers) a L<Math::Int64> object. The result is an array of exactly four numbers or (on Perls without 64-bit numbers) L<Math::Int64> objects.
63
64
65=back
66
096619f2
MG
67=head1 SEE ALSO
68
69L<https://github.com/google/highwayhash>
70
71=head1 AUTHOR
72
73Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
74
75=head1 COPYRIGHT AND LICENSE
76
77Copyright (C) 2018 by Marius Gavrilescu
78
79This library is free software; you can redistribute it and/or modify
80it under the same terms as Perl itself, either Perl version 5.24.1 or,
81at your option, any later version of Perl 5 you may have available.
82
83
84=cut
This page took 0.015233 seconds and 4 git commands to generate.