Digest::JHash(3pm)
π Digest::JHash π
okay so bestie. welcome to Digest::JHash β a Perl extension for the 32 bit Jenkins Hashing Algorithm. no cap, that's the whole vibe. β¨
πΈ SYNOPSIS πΈ
use Digest::JHash qw(jhash);
$digest = jhash($data);
# note that calling jhash() directly like this is the fastest way:
$digest = Digest::JHash::jhash($data);
like. look at it. it's giving efficiency π¦
π DESCRIPTION π
The Digest::JHash module lets you use the fast JHash hashing algorithm developed by Bob Jenkins from, like, inside your Perl programs. it's literally right there. π
So the algorithm takes as input a message of arbitrary length and produces as output a 32-bit "message digest" of the input, in the form of an unsigned long integer. slay.
Call it a low calorie version of MD5 if you like. π honestly? accurate.
See http://burtleburtle.net/bob/hash/doobs.html for more information β go read it, it's iconic. π
π FUNCTIONS π
jhash($data)
This function will calculate the JHash digest of the "message" in $data and return a 32 bit integer result (an unsigned long in the C). so cute. so small. so fast. π
π§ EXPORTS π§
None by default β but you can have the jhash() function if you ask nicely. π
and yeah, see below for reasons not to use Exporter (spoiler: it is slower than a direct call, oop π).
β SPEED NOTE β
okay so if speed is a major issue β and bestie, sometimes it is β listen up:
it's roughly twice as fast to call the jhash() function like this:
Digest::JHash::jhash('message')
than it is to import the jhash() method using Exporter so you can call it as simply:
jhash('message')
wild, right?? π the shortcut is the longcut. there's a short script that demonstrates the speed of different calling methods β direct, OO and Imported β in examples/oo_vs_func.pl. go run it, it ate. π₯
π AUTHORS π
- The JHash implementation was written by Bob Jenkins
<bob_jenkins [at] burtleburtle [dot] net>. - This perl extension was written by Andrew Towers
<mariofrog [at] bigpond [dot] com>. - A few mods were added by James Freeman
<airmedical [at] gmail [dot] com>).
three legends fr fr. π«Ά
π¦ SEE ALSO π¦
http://burtleburtle.net/bob/hash/doobs.html
π LICENSE π
This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Artistic License 2.0. A copy is include in this distribution. π
shoutout to the typo "include" β I'm keeping it exactly as written because we do not touch the facts, bestie. periodt. π
and that's the whole page!! this doc was served to you by perl v5.42.3, dated 2026-08-19, filed under Digest::JHash(3pm). mwah π go hash something, main character. β¨πΈπ¦
π¦ where this page comes from
- ubuntu stonking: libdigest-jhash-perl 0.10-2build6 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms