r61271 - in /branches/upstream/libdigest-jhash-perl: ./ current/ current/examples/ current/html/ current/lib/ current/lib/Digest/ current/misc/ current/t/

emhn-guest at users.alioth.debian.org emhn-guest at users.alioth.debian.org
Fri Aug 6 03:41:38 UTC 2010


Author: emhn-guest
Date: Fri Aug  6 03:41:25 2010
New Revision: 61271

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=61271
Log:
[svn-inject] Installing original source of libdigest-jhash-perl (0.06)

Added:
    branches/upstream/libdigest-jhash-perl/
    branches/upstream/libdigest-jhash-perl/current/
    branches/upstream/libdigest-jhash-perl/current/Changes
    branches/upstream/libdigest-jhash-perl/current/JHash.xs
    branches/upstream/libdigest-jhash-perl/current/MANIFEST
    branches/upstream/libdigest-jhash-perl/current/META.yml
    branches/upstream/libdigest-jhash-perl/current/Makefile.PL
    branches/upstream/libdigest-jhash-perl/current/README
    branches/upstream/libdigest-jhash-perl/current/SIGNATURE
    branches/upstream/libdigest-jhash-perl/current/examples/
    branches/upstream/libdigest-jhash-perl/current/examples/jhash.pl
    branches/upstream/libdigest-jhash-perl/current/examples/oo_vs_func.pl
    branches/upstream/libdigest-jhash-perl/current/html/
    branches/upstream/libdigest-jhash-perl/current/html/JHash.html
    branches/upstream/libdigest-jhash-perl/current/html/docs.css
    branches/upstream/libdigest-jhash-perl/current/lib/
    branches/upstream/libdigest-jhash-perl/current/lib/Digest/
    branches/upstream/libdigest-jhash-perl/current/lib/Digest/JHash.pm
    branches/upstream/libdigest-jhash-perl/current/misc/
    branches/upstream/libdigest-jhash-perl/current/misc/kwalitee.t
    branches/upstream/libdigest-jhash-perl/current/misc/make_manifest.pl
    branches/upstream/libdigest-jhash-perl/current/misc/mkdist.bat   (with props)
    branches/upstream/libdigest-jhash-perl/current/misc/spelling.t
    branches/upstream/libdigest-jhash-perl/current/t/
    branches/upstream/libdigest-jhash-perl/current/t/jhash.t
    branches/upstream/libdigest-jhash-perl/current/t/pod.t
    branches/upstream/libdigest-jhash-perl/current/t/pod_coverage.t

Added: branches/upstream/libdigest-jhash-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/Changes?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/Changes (added)
+++ branches/upstream/libdigest-jhash-perl/current/Changes Fri Aug  6 03:41:25 2010
@@ -1,0 +1,30 @@
+Revision history for Perl extension Digest::JHash.
+
+0.01  Sun Apr  6 19:10:33 2003
+    - original version; created by h2xs 1.21 with options
+        -An Digest::JHash
+
+0.02  Mon Apr 7 2003
+    - Changed untar dir structure to standard one
+    - Modified JHash.pm @EXPORT_OK so jhash() function can be exported on demand
+    - A small clean up to handle undef and null string input cases
+    - Added tests for the undef and null string input cases
+    - finished POD
+    - Added speed note to pod and demo script to misc/oo_vs_func.pl
+    - Added DEBUG const to C code for conveneience and to conform
+      with coding conventions of PHB
+    - Cleaned up Makefile.PL to minimal case
+
+0.03 Wed Jun 04 2008
+    - Repackaged into Kwalitee compliant package
+
+0.04 Wed Jun 04 2008
+    - Moved developer only tests kwalitee.t and spelling.t to misc/ to
+      stop kwalitee from demanding they be listed as build pre-reqs in META.yml
+
+0.05 Friday Jun 06 2008
+    - Patched to make algorithm compatible with unwanted 64 bit int in U32
+
+0.06 Mon Jul 26 2010
+    - Reuploading to get rid of the world-writable files and directories
+    in the archive.

Added: branches/upstream/libdigest-jhash-perl/current/JHash.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/JHash.xs?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/JHash.xs (added)
+++ branches/upstream/libdigest-jhash-perl/current/JHash.xs Fri Aug  6 03:41:25 2010
@@ -1,0 +1,99 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Jenkins Hash http://burtleburtle.net/bob/hash/doobs.html */
+
+const int DEBUG = 0;
+
+/* Need to constrain U32 to only 32 bits on 64 bit systems
+ * For efficiency we only use the & 0xffffffff if required
+ */
+#if BYTEORDER > 0x4321 || defined(TRUNCATE_U32)
+#define MIX(a,b,c) \
+{ \
+  a &= 0xffffffff; b &= 0xffffffff; c &= 0xffffffff; \
+  a -= b; a -= c; a ^= (c>>13); a &= 0xffffffff; \
+  b -= c; b -= a; b ^= (a<<8);  b &= 0xffffffff; \
+  c -= a; c -= b; c ^= (b>>13); c &= 0xffffffff; \
+  a -= b; a -= c; a ^= (c>>12); a &= 0xffffffff; \
+  b -= c; b -= a; b ^= (a<<16); b &= 0xffffffff; \
+  c -= a; c -= b; c ^= (b>>5);  c &= 0xffffffff; \
+  a -= b; a -= c; a ^= (c>>3);  a &= 0xffffffff; \
+  b -= c; b -= a; b ^= (a<<10); b &= 0xffffffff; \
+  c -= a; c -= b; c ^= (b>>15); c &= 0xffffffff; \
+}
+#else
+#define MIX(a,b,c) \
+{ \
+  a -= b; a -= c; a ^= (c>>13); \
+  b -= c; b -= a; b ^= (a<<8);  \
+  c -= a; c -= b; c ^= (b>>13); \
+  a -= b; a -= c; a ^= (c>>12); \
+  b -= c; b -= a; b ^= (a<<16); \
+  c -= a; c -= b; c ^= (b>>5);  \
+  a -= b; a -= c; a ^= (c>>3);  \
+  b -= c; b -= a; b ^= (a<<10); \
+  c -= a; c -= b; c ^= (b>>15); \
+}
+#endif
+
+U32 jhash( SV* str )
+{
+    STRLEN rawlen;
+    char* p;
+    U32 a, b, c, len, length;
+
+    /* extract the string data and string length from the perl scalar */
+    p = (char*)SvPV(str, rawlen);
+    length = len = (U32)rawlen;
+
+    /* Test for undef or null string case and return 0 */
+    if ( length == 0 ) {
+        DEBUG && printf( "Recieved a null or undef string!\n" );
+      return 0;
+    }
+
+    DEBUG && printf( "Received string '%.*s'.\n", (int)len, p );
+
+    a = b = 0x9e3779b9;        /* golden ratio suggested by Jenkins */
+    c = 0;
+    while (len >= 12)
+    {
+        a += (p[0] + (((U32)p[1])<<8) + (((U32)p[2])<<16) +
+              (((U32)p[3])<<24));
+        b += (p[4] + (((U32)p[5])<<8) + (((U32)p[6])<<16) +
+              (((U32)p[7])<<24));
+        c += (p[8] + (((U32)p[9])<<8) + (((U32)p[10])<<16) +
+              (((U32)p[11])<<24));
+        MIX(a, b, c);
+        p += 12;
+        len -= 12;
+    }
+    c += length;
+    switch(len) {
+    case 11: c+=((U32)p[10]<<24);
+    case 10: c+=((U32)p[9]<<16);
+    case 9:  c+=((U32)p[8]<<8);
+    case 8:  b+=((U32)p[7]<<24);
+    case 7:  b+=((U32)p[6]<<16);
+    case 6:  b+=((U32)p[5]<<8);
+    case 5:  b+=((U32)p[4]);
+    case 4:  a+=((U32)p[3]<<24);
+    case 3:  a+=((U32)p[2]<<16);
+    case 2:  a+=((U32)p[1]<<8);
+    case 1:  a+=((U32)p[0]);
+    }
+    MIX(a, b, c);
+    DEBUG && printf( "Hash value is %d.\n", (int)(c) );
+
+    return(c);
+}
+
+MODULE = Digest::JHash        PACKAGE = Digest::JHash
+
+PROTOTYPES: ENABLE
+
+U32
+jhash(str)
+    SV*    str

Added: branches/upstream/libdigest-jhash-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/MANIFEST?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/MANIFEST (added)
+++ branches/upstream/libdigest-jhash-perl/current/MANIFEST Fri Aug  6 03:41:25 2010
@@ -1,0 +1,19 @@
+MANIFEST
+Changes
+JHash.xs
+Makefile.PL
+META.yml
+README
+SIGNATURE
+examples/jhash.pl
+examples/oo_vs_func.pl
+misc/kwalitee.t
+misc/make_manifest.pl
+misc/mkdist.bat
+misc/spelling.t
+t/jhash.t
+t/pod.t
+t/pod_coverage.t
+lib/Digest/JHash.pm
+html/docs.css
+html/JHash.html

Added: branches/upstream/libdigest-jhash-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/META.yml?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/META.yml (added)
+++ branches/upstream/libdigest-jhash-perl/current/META.yml Fri Aug  6 03:41:25 2010
@@ -1,0 +1,21 @@
+--- #YAML:1.0
+name:               Digest-JHash
+version:            0.06
+abstract:           Perl extension for 32 bit Jenkins Hashing Algorithm
+author:
+    - Dr James Freeman
+license:            artistic_2
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
+requires:  {}
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.56
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Added: branches/upstream/libdigest-jhash-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/Makefile.PL?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/Makefile.PL (added)
+++ branches/upstream/libdigest-jhash-perl/current/Makefile.PL Fri Aug  6 03:41:25 2010
@@ -1,0 +1,13 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    'NAME'            => 'Digest::JHash',
+    'VERSION_FROM'    => 'lib/Digest/JHash.pm',
+    ($] >= 5.005 ?
+      (ABSTRACT_FROM  => 'lib/Digest/JHash.pm',
+       AUTHOR         => 'Dr James Freeman') :
+      ()
+    ),
+    LICENSE           => 'artistic_2',
+    realclean         => { FILES => 'Digest-JHash* *.tmp *.bak *.c' },
+);

Added: branches/upstream/libdigest-jhash-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/README?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/README (added)
+++ branches/upstream/libdigest-jhash-perl/current/README Fri Aug  6 03:41:25 2010
@@ -1,0 +1,33 @@
+Digest/JHash version 0.03
+=========================
+
+INSTALLATION
+
+To install this module type the following (nmake on Win32):
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+DEPENDENCIES
+
+None
+
+MORE DETAILS
+
+Read the POD in JHash.xs or the HTML version of that POD in html/JHash.html
+
+COPYLEFT AND UN-LICENCE
+
+This module is free software and is provided in the hope that it may prove useful.
+All care but no responsibility or liability. Use at own risk.
+
+May cause cancer if used excessively. Then again it may not.
+
+R&D (Rip-off and Duplicate) as desired.
+
+Feel free to remove this copyright and call it your own if that makes you happy.
+
+Copyright (C) 2003-2008 Andrew Towers and James Freeman.
+

Added: branches/upstream/libdigest-jhash-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/SIGNATURE?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/SIGNATURE (added)
+++ branches/upstream/libdigest-jhash-perl/current/SIGNATURE Fri Aug  6 03:41:25 2010
@@ -1,0 +1,43 @@
+This file contains message digests of all files listed in MANIFEST,
+signed via the Module::Signature module, version 0.55.
+
+To verify the content in this distribution, first make sure you have
+Module::Signature installed, then type:
+
+    % cpansign -v
+
+It will check each file's integrity, as well as the signature's
+validity.  If "==> Signature verified OK! <==" is not displayed,
+the distribution may already have been compromised, and you should
+not run its Makefile.PL or Build.PL.
+
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+SHA1 78495ba03ffe0320e0b7ac812cf3c6fa3ca65911 Changes
+SHA1 9a3c4a096e94d38aae3ae3c94dca598123bd67ae JHash.xs
+SHA1 dbc3072b986c794995069736e0f43d3fb890307d MANIFEST
+SHA1 5f1bcf8ea6cdfa7d135986f385695fe568575b3f META.yml
+SHA1 bdb56cf7eda7ea5235c76c1317eda9c8ca382fab Makefile.PL
+SHA1 23ba39bf5a130f18440559e6ae24cd2e5bfac880 README
+SHA1 c61feb168d68aa03110344bc534a4615b5e4ede1 examples/jhash.pl
+SHA1 765dbbae4f3e52a75e246da1f0f1de6c0f2b2ca9 examples/oo_vs_func.pl
+SHA1 3335b34c8200680f604ecd2eeea68443d6865d2e html/JHash.html
+SHA1 d90c797dc2c8eba2986207094b1ea8ec084008d9 html/docs.css
+SHA1 815ee12e61cd0b9dd580fdd9bd8847b5f83b1260 lib/Digest/JHash.pm
+SHA1 e025dfa24a881d66b0b2e4074d7dec859e14811e misc/kwalitee.t
+SHA1 caeefb74df20ef182263a30796d1fe21826d43e2 misc/make_manifest.pl
+SHA1 74440f42d3c5784eb32b5f9dc60c9de277092796 misc/mkdist.bat
+SHA1 8e8ace77d3b6013fcbc9fcad5191f3a37df59c3c misc/spelling.t
+SHA1 60719436aa8f28602e5bdb8efb6b30cc12581727 t/jhash.t
+SHA1 af1136d14010cbb2bfde90acc9c345ce188bf0fb t/pod.t
+SHA1 b5280719d86dcda716c79e1e5c9592425a888ed3 t/pod_coverage.t
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (MingW32)
+
+iJwEAQECAAYFAkhJOGMACgkQngy2BUOcVTM5NQP/agZ/Fa6Wj1EA3+QHztwo+lhG
+nssnfwngVdxj/EMfnKREaOKfOWqvKp6R9rjG2NxZfQ7mZJceWxgDrsGV73m/RmFK
++OaZriSYVg9daCMXWz7Sccf0EBkEgOMRL/hJPPdI9e7aBhQhLq4kxepKjWv9d3Gf
+HIL0HpAKr9gD+KyfDYE=
+=7E9x
+-----END PGP SIGNATURE-----

Added: branches/upstream/libdigest-jhash-perl/current/examples/jhash.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/examples/jhash.pl?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/examples/jhash.pl (added)
+++ branches/upstream/libdigest-jhash-perl/current/examples/jhash.pl Fri Aug  6 03:41:25 2010
@@ -1,0 +1,20 @@
+#!/usr/bin/perl -w
+use strict;
+use Digest::JHash 'jhash';
+
+if ($ARGV[0]) {
+    if ( -f $ARGV[0] ) {
+        local $/;
+        open F, $ARGV[0] or die "Can't read $ARGV[0] $!\n";
+        my $data = <F>;
+        close F;
+        printf "File: $ARGV[0] => %u\n", jhash($data);
+    }
+    else {
+        printf "String: $ARGV[0] => %u\n", jhash($ARGV[0]);
+    }
+}
+else {
+    print "Usage $0 <file or string>\n";
+}
+

Added: branches/upstream/libdigest-jhash-perl/current/examples/oo_vs_func.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/examples/oo_vs_func.pl?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/examples/oo_vs_func.pl (added)
+++ branches/upstream/libdigest-jhash-perl/current/examples/oo_vs_func.pl Fri Aug  6 03:41:25 2010
@@ -1,0 +1,38 @@
+#!/usr/bin/perl
+
+package Test;
+
+use Benchmark;
+$count = 10_000_000;
+$foo = new Foo;
+
+# import do_foo into this package, normally exported out of package Foo
+# using Exporter but this is the key line of code that does it
+*{Test::do_foo} = sub { Foo::do_foo() };
+
+timethese( $count,
+    {
+        'OO'        => '$foo->do_foo()',
+        'Function'  => 'Foo::do_foo()',
+        'Import'    => 'do_foo()',
+    }
+);
+
+# note that $oo and $ff got auto-vivified (not declared, made on first use)
+# this is one of the reasons so many people write shit code in Perl.
+printf "\nOO %d\nFF %d\n", $oo, $ff;
+
+package Foo;
+
+sub new { bless { key => 'val' }, shift }
+
+sub do_foo { $_[0] ? $Test::oo++ : $Test::ff++ }
+
+__DATA__
+Benchmark: timing 10000000 iterations of Function, Import, OO...
+  Function:  8 wallclock secs ( 7.99 usr +  0.00 sys =  7.99 CPU) @ 1251251.25/s (n=10000000)
+    Import: 12 wallclock secs (12.72 usr +  0.00 sys = 12.72 CPU) @ 786225.33/s (n=10000000)
+        OO:  9 wallclock secs ( 9.33 usr +  0.00 sys =  9.33 CPU) @ 1071352.05/s (n=10000000)
+
+OO 10000000
+FF 20000000

Added: branches/upstream/libdigest-jhash-perl/current/html/JHash.html
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/html/JHash.html?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/html/JHash.html (added)
+++ branches/upstream/libdigest-jhash-perl/current/html/JHash.html Fri Aug  6 03:41:25 2010
@@ -1,0 +1,129 @@
+<?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>

Added: branches/upstream/libdigest-jhash-perl/current/html/docs.css
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/html/docs.css?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/html/docs.css (added)
+++ branches/upstream/libdigest-jhash-perl/current/html/docs.css Fri Aug  6 03:41:25 2010
@@ -1,0 +1,107 @@
+BODY {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+    background-color: white;
+}
+
+A:link    {color: #0000FF}
+A:visited     {color: #666666}
+A:active     {color: #FF0000}
+
+H1 {
+    font: bold large verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+H2 {
+    font: bold large verdana, arial, helvetica, sans-serif;
+    color: maroon;
+}
+H3 {
+    font: bold medium verdana, arial, helvetica, sans-serif;
+        color: blue;
+}
+H4 {
+    font: bold small verdana, arial, helvetica, sans-serif;
+        color: maroon;
+}
+H5 {
+    font: bold small verdana, arial, helvetica, sans-serif;
+        color: blue;
+}
+H6 {
+    font: bold small verdana, arial, helvetica, sans-serif;
+        color: black;
+}
+UL {
+    font: small verdana, arial, helvetica, sans-serif;
+        color: black;
+}
+OL {
+    font: small verdana, arial, helvetica, sans-serif;
+        color: black;
+}
+LI {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+TH {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+TD {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+TD.foot {
+     font: medium sans-serif;
+     color: #eeeeee;
+    background-color="#cc0066"
+}
+DL {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+DD {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+DT {
+    font: small verdana, arial, helvetica, sans-serif;
+        color: black;
+}
+CODE {
+    font: Courier, monospace;
+}
+PRE {
+    font: Courier, monospace;
+}
+P.indent {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+    background-color: white;
+    list-style-type : circle;
+    list-style-position : inside;
+    margin-left : 16.0pt;
+}
+PRE.programlisting
+{
+    font-size : 9.0pt;
+    list-style-type : disc;
+    margin-left : 16.0pt;
+    margin-top : -14.0pt;
+}
+INPUT {
+    font: bold small verdana, arial, helvetica, sans-serif;
+    color: black;
+    background-color: white;
+}
+TEXTAREA {
+    font: bold small verdana, arial, helvetica, sans-serif;
+    color: black;
+    background-color: white;
+}
+.BANNER {
+    background-color: "#cccccc";
+    font: bold medium verdana, arial, helvetica, sans-serif;
+}
+

Added: branches/upstream/libdigest-jhash-perl/current/lib/Digest/JHash.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/lib/Digest/JHash.pm?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/lib/Digest/JHash.pm (added)
+++ branches/upstream/libdigest-jhash-perl/current/lib/Digest/JHash.pm Fri Aug  6 03:41:25 2010
@@ -1,0 +1,94 @@
+package Digest::JHash;
+
+use strict;
+use warnings;
+require Exporter;
+require DynaLoader;
+use vars qw(@ISA @EXPORT_OK $VERSION);
+
+ at ISA = qw(Exporter DynaLoader);
+
+ at EXPORT_OK = qw( jhash );
+$VERSION   = '0.06';
+
+bootstrap Digest::JHash $VERSION;
+
+1;
+
+__END__
+
+=pod
+
+=for stopwords JHash burtleburtle bigpond Jenkins
+
+=head1 NAME
+
+Digest::JHash - Perl extension for 32 bit Jenkins Hashing Algorithm
+
+=head1 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);
+
+=head1 DESCRIPTION
+
+The C<Digest::JHash> 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
+"message digest" of the input in the form of an unsigned long integer.
+
+Call it a low calorie version of MD5 if you like.
+
+See http://burtleburtle.net/bob/hash/doobs.html for more information.
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item 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)
+
+=back
+
+=head1 EXPORTS
+
+None by default but you can have the jhash() function if you ask nicely.
+See below for reasons not to use Exporter (it is slower than a direct call)
+
+=head1 SPEED NOTE
+
+If speed is a major issue it is roughly twice as fast to do call the jhash()
+function like Digest::JHash::jhash('message') than it is to import the
+jhash() 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
+
+=head1 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>).
+
+=head1 SEE ALSO
+
+http://burtleburtle.net/bob/hash/doobs.html
+
+=head1 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.
+
+=cut

Added: branches/upstream/libdigest-jhash-perl/current/misc/kwalitee.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/misc/kwalitee.t?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/misc/kwalitee.t (added)
+++ branches/upstream/libdigest-jhash-perl/current/misc/kwalitee.t Fri Aug  6 03:41:25 2010
@@ -1,0 +1,28 @@
+use Test;
+use Cwd;
+
+#$ENV{RELEASE_TESTING}++;
+
+my $chdir = 0;
+if ( cwd() =~ m/t$/ ) {
+    chdir "..";
+    $chdir++;
+}
+
+eval { require Test::Kwalitee;};
+
+if ($@) {
+    plan tests => 1;
+    skip("Test::Kwalitee not installed; skipping");
+}
+else {
+    if ( $ENV{RELEASE_TESTING} ) {
+        Test::Kwalitee->import();
+    }
+    else {
+        plan tests => 1;
+        skip( "Author only private tests" );
+    }
+}
+
+chdir "t" if $chdir;  # back to t/

Added: branches/upstream/libdigest-jhash-perl/current/misc/make_manifest.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/misc/make_manifest.pl?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/misc/make_manifest.pl (added)
+++ branches/upstream/libdigest-jhash-perl/current/misc/make_manifest.pl Fri Aug  6 03:41:25 2010
@@ -1,0 +1,244 @@
+#!/usr/bin/perl -w
+
+# make_manifest.pl - get ready to tarball a module for CPAN
+# It makes really clean, writes  a /html dir from the .pm pod,
+# writes an accurate manifest and then fixes up all the line endings.
+
+use strict;
+use Pod::Html;
+use Cwd;
+
+chdir ".." if cwd =~ m/misc$/;
+
+my $backup = 0;
+my $root = shift @ARGV || '.'; #'../;
+$root =~ tr|\\|/|;
+$root = "$root/" unless $root =~ m|/$|;
+
+write_file("SIGNATURE");
+write_file("META.yml");
+make_clean($root);
+my $htmldir = $root."html/";
+mkdir $htmldir, 0777;      # make the html dir
+unlink <$htmldir*>;        # make sure it is empty
+
+# write license file
+require Software::License::Artistic_2_0;
+unless ($@) {
+    my $license = Software::License::Artistic_2_0->new({holder => 'James Freeman',});
+    open F, ">../LICENSE" or die "Can't write LICENSE $!\n";
+    print F $license->fulltext;
+    close F;
+}
+
+my ( $dirs, $files ) = recurse_tree($root);
+my @files;
+# erase any undesirable files ie .bak, .pbp
+for (@$files) {
+    unlink, next if m/\.(?:pbp|bak|gz)$/;
+    push @files, $_; # add files that we don't erase
+}
+
+# write the HTML
+write_file( $htmldir."docs.css", (join'',<DATA>) ); # write the css
+push @files, $htmldir."docs.css";
+for my $pm (grep { m/\.pm$/  } @files ) {
+    my $name = make_html($pm);
+    push @files, $htmldir.$name;
+}
+
+# clean up after pod2html!
+unlink <./pod2htm*>;
+
+# write the MANIFEST;
+unshift @files, $root.'MANIFEST';
+write_file( $root."MANIFEST", (join"\n", map{ m/\Q$root\E(.*)/o ;$1 }@files) );
+
+# fix line endings
+fix_line_endings($_) for @files;
+
+# remove all the makefile/make rubbish
+sub make_clean {
+    my $root = shift;
+    my ($dirs, $files) = recurse_tree( $root."blib/" );
+    my @dirs  = @$dirs;
+    my @files = @$files;
+    unlink for @files;
+    # need to do longest dir paths first - must be deepest
+    rmdir for sort {length $b <=> length $a }@dirs;
+    my @makefiles = grep { /makefile(?!\.PL)/i } <$root*>;
+    unlink for ( @makefiles, $root.'&1', $root.'pm_to_blib', $root.'MANIFEST', $root.'manifest' );
+    unlink <${root}pod2htm*>;
+}
+
+# recurse the directory tree
+sub recurse_tree {
+    my $root = shift;
+    my @files;
+    my @dirs = ($root);
+    for my $dir (@dirs) {
+        opendir DIR, $dir or next;
+        while (my $file = readdir DIR) {
+          next if $file eq '.' or $file eq '..';
+          next if  -l "$dir$file";
+            if ( -d "$dir$file" ) {
+                push @dirs,  "$dir$file/";
+            }
+            elsif ( -f "$dir$file" ) {
+                push @files, "$dir$file";
+            }
+        }
+        closedir DIR;
+    }
+  return \@dirs, \@files;
+}
+
+# clean windows line ending away
+sub fix_line_endings {
+    my $file = shift;
+    return if $file =~ m/.bat$/;
+    local $/;
+    open my $fh, "+<$file" or die "Can't open $file for R/W $!\n";
+    binmode $fh;
+    my $data = <$fh>;
+    write_file( "$file.bak" , $data ) if $backup;
+    $data =~ s/\015\012/\012/g;
+    $data =~ s/ +\012/\012/g;
+    $data =~ s/\t/    /g;
+    seek $fh, 0, 0;
+    truncate $fh, 0;
+    print $fh $data;
+    close $fh;
+    $file =~ s/\Q$root\E//o;
+    print "Processed $file\n";
+}
+
+# make HTML from the pod
+sub make_html {
+    my $file = shift;
+    (my $name) = $file =~ m/([^\/\\]+)\.pm$/;
+    print "Writing html/$name.html\n";
+    pod2html(   "--infile=$file",
+                "--header",
+                "--title=$name.pm",
+                "--css=${htmldir}docs.css",
+                "--outfile=$htmldir$name.html",
+                "--quiet" );
+  return "$name.html";
+}
+
+sub write_file {
+    my $file = shift;
+    open F, ">$file" or die "Can't write $file: $!\n";
+    print F for @_;
+    close F;
+}
+
+__DATA__
+BODY {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+    background-color: white;
+}
+
+A:link    {color: #0000FF}
+A:visited     {color: #666666}
+A:active     {color: #FF0000}
+
+H1 {
+    font: bold large verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+H2 {
+    font: bold large verdana, arial, helvetica, sans-serif;
+    color: maroon;
+}
+H3 {
+    font: bold medium verdana, arial, helvetica, sans-serif;
+        color: blue;
+}
+H4 {
+    font: bold small verdana, arial, helvetica, sans-serif;
+        color: maroon;
+}
+H5 {
+    font: bold small verdana, arial, helvetica, sans-serif;
+        color: blue;
+}
+H6 {
+    font: bold small verdana, arial, helvetica, sans-serif;
+        color: black;
+}
+UL {
+    font: small verdana, arial, helvetica, sans-serif;
+        color: black;
+}
+OL {
+    font: small verdana, arial, helvetica, sans-serif;
+        color: black;
+}
+LI {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+TH {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+TD {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+TD.foot {
+     font: medium sans-serif;
+     color: #eeeeee;
+    background-color="#cc0066"
+}
+DL {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+DD {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+}
+DT {
+    font: small verdana, arial, helvetica, sans-serif;
+        color: black;
+}
+CODE {
+    font: Courier, monospace;
+}
+PRE {
+    font: Courier, monospace;
+}
+P.indent {
+    font: small verdana, arial, helvetica, sans-serif;
+    color: black;
+    background-color: white;
+    list-style-type : circle;
+    list-style-position : inside;
+    margin-left : 16.0pt;
+}
+PRE.programlisting
+{
+    font-size : 9.0pt;
+    list-style-type : disc;
+    margin-left : 16.0pt;
+    margin-top : -14.0pt;
+}
+INPUT {
+    font: bold small verdana, arial, helvetica, sans-serif;
+    color: black;
+    background-color: white;
+}
+TEXTAREA {
+    font: bold small verdana, arial, helvetica, sans-serif;
+    color: black;
+    background-color: white;
+}
+.BANNER {
+    background-color: "#cccccc";
+    font: bold medium verdana, arial, helvetica, sans-serif;
+}
+

Added: branches/upstream/libdigest-jhash-perl/current/misc/mkdist.bat
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/misc/mkdist.bat?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/misc/mkdist.bat (added)
+++ branches/upstream/libdigest-jhash-perl/current/misc/mkdist.bat Fri Aug  6 03:41:25 2010
@@ -1,0 +1,5 @@
+perl Makefile.PL
+nmake realclean
+perl misc\make_manifest.pl
+perl Makefile.PL
+nmake distsignature

Propchange: branches/upstream/libdigest-jhash-perl/current/misc/mkdist.bat
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libdigest-jhash-perl/current/misc/spelling.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/misc/spelling.t?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/misc/spelling.t (added)
+++ branches/upstream/libdigest-jhash-perl/current/misc/spelling.t Fri Aug  6 03:41:25 2010
@@ -1,0 +1,47 @@
+use Test;
+use Cwd;
+my $ASPELL = "C:\\usr\\Aspell\\bin\\aspell.exe";
+
+#$ENV{RELEASE_TESTING}++;
+
+my $chdir = 0;
+
+if ( cwd() =~ m/t$/ ) {
+    chdir "..";
+    $chdir++;
+}
+
+eval { require Test::Spelling; Test::Spelling->import; };
+
+if ($@) {
+    plan tests => 1;
+    skip("Test::Spelling not installed; skipping");
+}
+else {
+    if ( $ENV{RELEASE_TESTING} ) {
+        set_spell_cmd("$ASPELL -l");
+        add_stopwords(<DATA>);
+        all_pod_files_spelling_ok('lib');
+    }
+    else {
+        plan tests => 1;
+        skip( "Author only private tests" );
+    }
+}
+
+chdir "t" if $chdir;  # back to t/
+
+__DATA__
+CGI
+CPAN
+GPL
+STDIN
+STDOUT
+DWIM
+OO
+RTFM
+RTFS
+James
+Freeman
+gmail
+behaviour

Added: branches/upstream/libdigest-jhash-perl/current/t/jhash.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/t/jhash.t?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/t/jhash.t (added)
+++ branches/upstream/libdigest-jhash-perl/current/t/jhash.t Fri Aug  6 03:41:25 2010
@@ -1,0 +1,20 @@
+use Test;
+use strict;
+
+BEGIN { plan tests => 5 };
+use Digest::JHash;
+
+ok(1); # If we made it this far, we loaded ok
+
+ok( Digest::JHash::jhash("hello world"), 447289830 );
+ok( Digest::JHash::jhash("goodbye cruel world"), 969307542 );
+
+# make sure we don't explode unexpectedly if passed null
+{
+    # kill warnings in this block
+    local $^W = 0;
+    ok( Digest::JHash::jhash(undef), 0 );
+    ok( Digest::JHash::jhash(''), 0 );
+}
+
+# warnings are active again here

Added: branches/upstream/libdigest-jhash-perl/current/t/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/t/pod.t?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/t/pod.t (added)
+++ branches/upstream/libdigest-jhash-perl/current/t/pod.t Fri Aug  6 03:41:25 2010
@@ -1,0 +1,18 @@
+use Test;
+
+#$ENV{RELEASE_TESTING}++;
+
+eval "use Test::Pod 1.00";
+
+if ($@) {
+    print "1..0 # Skip Test::Pod 1.00 required for testing POD\n";
+}
+else {
+    if ( $ENV{RELEASE_TESTING} ) {
+        my @poddirs = qw(lib ../lib);
+        all_pod_files_ok(all_pod_files( @poddirs ));
+    }
+    else {
+        print "1..0 # Skip Author only pod tests not required\n";
+    }
+}

Added: branches/upstream/libdigest-jhash-perl/current/t/pod_coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdigest-jhash-perl/current/t/pod_coverage.t?rev=61271&op=file
==============================================================================
--- branches/upstream/libdigest-jhash-perl/current/t/pod_coverage.t (added)
+++ branches/upstream/libdigest-jhash-perl/current/t/pod_coverage.t Fri Aug  6 03:41:25 2010
@@ -1,0 +1,30 @@
+use Test;
+use Cwd;
+
+my $ALSO_PRIVATE = [ ];
+
+#$ENV{RELEASE_TESTING}++;
+
+my $chdir = 0;  # Test::Pod::Coverage is brain dead and won't find
+                # lib or blib when run from t/, nor can you tell it
+                # where to look
+if ( cwd() =~ m/t$/ ) {
+    chdir "..";
+    $chdir++;
+}
+
+eval "use Test::Pod::Coverage 1.00";
+
+if ($@) {
+    print "1..0 Skip # Test::Pod::Coverage 1.00 required for testing POD\n";
+}
+else {
+    if ( $ENV{RELEASE_TESTING} ) {
+        all_pod_coverage_ok( { also_private => $ALSO_PRIVATE } );
+    }
+    else {
+        print "1..0 # Skip Author only pod coverage tests not required\n";
+    }
+}
+
+chdir "t" if $chdir;  # back to t/




More information about the Pkg-perl-cvs-commits mailing list