e69ad0a0929ea861809621b6db1a44fae482c4b5
1 package Digest
::HighwayHash
;
6 use parent qw
/Exporter/;
8 our @EXPORT_OK = qw
/highway_hash64 highway_hash128 highway_hash256/;
9 our @EXPORT = @EXPORT_OK;
11 our $VERSION = '0.001001';
16 XSLoader
::load
('Digest::HighwayHash', $VERSION);
25 Digest::HighwayHash - XS fast strong keyed hash function
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
39 HighwayHash is a fast and strong keyed hash function, documented at
40 L<https://github.com/google/highwayhash>.
42 Three functions are exported by this module, all by default:
46 =item B<highway_hash64> I<\@key>, I<$input>
48 Compute the 64-bit HighwayHash of I<$input>, using I<\@key> as a key.
49 The key must be a 4-element arrayref, with each element either a
50 number 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.
52 =item B<highway_hash128> I<\@key>, I<$input>
54 Compute the 128-bit HighwayHash of I<$input>, using I<\@key> as a key.
55 The key must be a 4-element arrayref, with each element either a
56 number 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.
58 =item B<highway_hash256> I<\@key>, I<$input>
60 Compute the 256-bit HighwayHash of I<$input>, using I<\@key> as a key.
61 The key must be a 4-element arrayref, with each element either a
62 number 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.
69 L<https://github.com/google/highwayhash>
73 Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
75 =head1 COPYRIGHT AND LICENSE
77 Copyright (C) 2018 by Marius Gavrilescu
79 This library is free software; you can redistribute it and/or modify
80 it under the same terms as Perl itself, either Perl version 5.24.1 or,
81 at your option, any later version of Perl 5 you may have available.
This page took 0.024273 seconds and 3 git commands to generate.