The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JHash.pm</title>
<link rel="stylesheet" href="./html/docs.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body>
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="block" valign="middle">
<big><strong><span class="block">&nbsp;JHash.pm</span></strong></big>
</td></tr>
</table>


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>

<ul>

    <li><a href="#name">NAME</a></li>
    <li><a href="#synopsis">SYNOPSIS</a></li>
    <li><a href="#description">DESCRIPTION</a></li>
    <li><a href="#functions">FUNCTIONS</a></li>
    <li><a href="#exports">EXPORTS</a></li>
    <li><a href="#speed_note">SPEED NOTE</a></li>
    <li><a href="#authors">AUTHORS</a></li>
    <li><a href="#see_also">SEE ALSO</a></li>
    <li><a href="#license">LICENSE</a></li>
</ul>

<hr name="index" />
</div>
<!-- INDEX END -->

<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p>Digest::JHash - Perl extension for 32 bit Jenkins Hashing Algorithm</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
    <span class="keyword">use</span> <span class="variable">Digest::JHash</span> <span class="string">qw(jhash)</span><span class="operator">;</span>
</pre>
<pre>
    <span class="variable">$digest</span> <span class="operator">=</span> <span class="variable">jhash</span><span class="operator">(</span><span class="variable">$data</span><span class="operator">);</span>
</pre>
<pre>
    <span class="comment"># note that calling jhash() directly like this is the fastest way:</span>
</pre>
<pre>
    <span class="variable">$digest</span> <span class="operator">=</span> <span class="variable">Digest::JHash::jhash</span><span class="operator">(</span><span class="variable">$data</span><span class="operator">);</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The <code>Digest::JHash</code> module allows you to use the fast JHash hashing algorithm
developed by Bob Jenkins from within Perl programs. The algorithm takes as
input a message of arbitrary length and produces as output a 32-bit
&quot;message digest&quot; of the input in the form of an unsigned long integer.</p>
<p>Call it a low calorie version of MD5 if you like.</p>
<p>See <a href="http://burtleburtle.net/bob/hash/doobs.html">http://burtleburtle.net/bob/hash/doobs.html</a> for more information.</p>
<p>
</p>
<hr />
<h1><a name="functions">FUNCTIONS</a></h1>
<dl>
<dt><strong><a name="jhash" class="item"><code>jhash($data)</code></a></strong>

<dd>
<p>This function will calculate the JHash digest of the &quot;message&quot; in $data
and return a 32 bit integer result (an unsigned long in the C)</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="exports">EXPORTS</a></h1>
<p>None by default but you can have the <a href="#item_jhash"><code>jhash()</code></a> function if you ask nicely.
See below for reasons not to use Exporter (it is slower than a direct call)</p>
<p>
</p>
<hr />
<h1><a name="speed_note">SPEED NOTE</a></h1>
<p>If speed is a major issue it is roughly twice as fast to do call the <a href="#item_jhash"><code>jhash()</code></a>
function like Digest::JHash::jhash('message') than it is to import the
<a href="#item_jhash"><code>jhash()</code></a> method using Exporter so you can call it as simply jhash('message').
There is a short script that demonstrates the speed of different calling
methods (direct, OO and Imported) in examples/oo_vs_func.pl</p>
<p>
</p>
<hr />
<h1><a name="authors">AUTHORS</a></h1>
<p>The JHash implementation was written by Bob Jenkins
&lt;bob_jenkins [at] burtleburtle [dot] net&gt;.</p>
<p>This perl extension was written by Andrew Towers
&lt;mariofrog [at] bigpond [dot] com&gt;.</p>
<p>A few mods were added by James Freeman
&lt;airmedical [at] gmail [dot] com&gt;).</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><a href="http://burtleburtle.net/bob/hash/doobs.html">http://burtleburtle.net/bob/hash/doobs.html</a></p>
<p>
</p>
<hr />
<h1><a name="license">LICENSE</a></h1>
<p>This package is free software and is provided &quot;as is&quot; 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.</p>
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="block" valign="middle">
<big><strong><span class="block">&nbsp;JHash.pm</span></strong></big>
</td></tr>
</table>

</body>

</html>