1Digest::JHash(3) User Contributed Perl Documentation Digest::JHash(3)
2
3
4
6 Digest::JHash - Perl extension for 32 bit Jenkins Hashing Algorithm
7
9 use Digest::JHash qw(jhash);
10
11 $digest = jhash($data);
12
13 # note that calling jhash() directly like this is the fastest way:
14
15 $digest = Digest::JHash::jhash($data);
16
18 The "Digest::JHash" module allows you to use the fast JHash hashing
19 algorithm developed by Bob Jenkins from within Perl programs. The
20 algorithm takes as input a message of arbitrary length and produces as
21 output a 32-bit "message digest" of the input in the form of an
22 unsigned long integer.
23
24 Call it a low calorie version of MD5 if you like.
25
26 See http://burtleburtle.net/bob/hash/doobs.html for more information.
27
29 jhash($data)
30 This function will calculate the JHash digest of the "message" in
31 $data and return a 32 bit integer result (an unsigned long in the
32 C)
33
35 None by default but you can have the jhash() function if you ask
36 nicely. See below for reasons not to use Exporter (it is slower than a
37 direct call)
38
40 If speed is a major issue it is roughly twice as fast to do call the
41 jhash() function like Digest::JHash::jhash('message') than it is to
42 import the jhash() method using Exporter so you can call it as simply
43 jhash('message'). There is a short script that demonstrates the speed
44 of different calling methods (direct, OO and Imported) in
45 examples/oo_vs_func.pl
46
48 The JHash implementation was written by Bob Jenkins <bob_jenkins [at]
49 burtleburtle [dot] net>.
50
51 This perl extension was written by Andrew Towers <mariofrog [at]
52 bigpond [dot] com>.
53
54 A few mods were added by James Freeman <airmedical [at] gmail [dot]
55 com>).
56
58 http://burtleburtle.net/bob/hash/doobs.html
59
61 This package is free software and is provided "as is" without express
62 or implied warranty. It may be used, redistributed and/or modified
63 under the terms of the Artistic License 2.0. A copy is include in this
64 distribution.
65
66
67
68perl v5.30.1 2020-01-29 Digest::JHash(3)