This is hashes.egg.info, produced by makeinfo version 4.7 from
eggdoc-output.texi.

INFO-DIR-SECTION The Algorithmic Language Scheme
START-INFO-DIR-ENTRY
* hashes.egg: (hashes.egg).		Miscellaneous Hash Functions
END-INFO-DIR-ENTRY


File: hashes.egg.info,  Node: Top,  Next: About this egg,  Up: (dir)

hashes egg
**********

Miscellaneous Hash Functions

Written by Kon Lovett (mailto:klovett@pacbell.net)

   This manual corresponds to version 1.9 of the hashes extension
library for Chicken Scheme.

* Menu:

* About this egg::
* Documentation::
* License::
* Index::


File: hashes.egg.info,  Node: About this egg,  Next: Documentation,  Prev: Top,  Up: Top

1 About this egg
****************

* Menu:

* Version history::
* Requirements::
* Usage::


File: hashes.egg.info,  Node: Version history,  Next: Requirements,  Up: About this egg

1.1 Version history
===================

`1.9'
     Rename of make-inexact -> make-real, bug fix tounsigned-int32

`1.8'
     Exports

`1.7'
     Fix for undeclared uint16_t [Thanks to Benedikt Rosenau]

`1.6'
     Rename of unsigned-long to unsigned-int32, needs Chicken 2.3+

`1.5'
     Minor implementation changes, needs box 1.1+

`1.4'
     Added dependency on box

`1.3'
     Added Fowler/Noll/Vo hash

`1.2'
     Update doc & renamed string->unsigned-long

`1.1'
     Added procs

`1.0'
     Initial release


File: hashes.egg.info,  Node: Requirements,  Next: Usage,  Prev: Version history,  Up: About this egg

1.2 Requirements
================

This egg requires the following extensions:

   `message-digest', `crc', `box', `misc-extn', `miscmacros'


File: hashes.egg.info,  Node: Usage,  Prev: Requirements,  Up: About this egg

1.3 Usage
=========

Load this egg like so:

   `(require-extension hashes)'


File: hashes.egg.info,  Node: Documentation,  Next: License,  Prev: About this egg,  Up: Top

2 Documentation
***************

* Menu:

* Hash Procedures::
* Hash Auxillary Procedures::
* Digest Procedures::
* Miscellaneous Procedures::


File: hashes.egg.info,  Node: Hash Procedures,  Next: Hash Auxillary Procedures,  Up: Documentation

2.1 Hash Procedures
===================

A suite of hash procedures. All have the same signature. All
return hash values in a 32-bit range, so non-fixnum results
possible! The `HASH' name refers to one of the hash 				algorithm symbols
below.

   Though this egg is categorized as 'cryptographic' not a one
of these is suitable for cryptographic work!

   The hash values produced are not necessarily portable 				across
big/little-endian machines.

 -- procedure: HASH-prim
          (HASH-prim STRING LENGTH SEED)

     Returns the HASH-prim of `STRING' of `LENGTH', 					using `SEED'.

 -- procedure: HASH
          (HASH STRING [LENGTH [SEED]])

     Returns the HASH-prim of `STRING'. When `LENGTH' is missing
     `(string-length STRING)' is 					assumed. When `SEED' is missing 0 is
     assumed.

`RJMXHash'
     Bob Jenkins' MIX hash function.

`TWMXHash'
     Thomas Wang's MIX hash function.

`FNVHash'
     Fowler/Noll/Vo 1 hash function. Substitutes the 						algorithm's
     initial value when the seed is non-zero.

`FNVAHash'
     Fowler/Noll/Vo 1a hash function. Substitutes the 						algorithm's
     initial value when the seed is non-zero.

`PHSFHash'
     Paul Hsieh's SuperFast hash function. Substitutes the
     algorithm's initial value when the seed is non-zero.

`RSHash'
     Robert Sedgwick's "Algorithms in C" hash function.

`JSHash'
     A bitwise hash function written by Justin Sobel. Ignores
     the seed when 0.

`PJWHash'
     Hash algorithm is based on work by Peter J. Weinberger 						of
     AT&T Bell Labs.

`ELFHash'
     Similar to the PJW Hash function, but tweaked for 						32-bit
     processors. It's the hash function widely used on 						most UNIX
     systems.

`BKDRHash'
     This hash function comes from Brian Kernighan and 						Dennis Ritchie's
     book "The C Programming Language". It 						is a simple hash
     function using a strange set of possible 						seeds which all
     constitute a pattern of 31....31...31 etc, 						it seems to be very
     similar to the DJB hash function

`SDBMHash'
     This is the algorithm of choice which is used in the 						open
     source SDBM project. The hash function seems to have 						a
     good over-all distribution for many different data sets.
     It seems to work well in situations where there is a high
     variance in the MSBs of the elements in a data set.

`DJBHash'
     An algorithm produced by Professor Daniel J. Bernstein 						and
     shown first to the world on the usenet newsgroup 						comp.lang.c. It
     is one of the most efficient hash functions 						ever published.
     Substitutes the algorithm's initial value 						when the seed is
     non-zero.

`NDJBHash'
     Now favored by Bernstein. Substitutes the algorithm's
     initial value when the seed is non-zero.

`DEKHash'
     An algorithm proposed by Donald E. Knuth in "The Art Of
     Computer Programming, Volume 3", under the topic of sorting 						and
     search chapter 6.4. Substitutes the algorithm's initial
     value when the seed is non-zero.

`APHash'
     Arash Partow's hash function. A hybrid rotative and
     additive hash function algorithm based around four primes
     3, 5, 7, and 11.

`CRCHash'
     The `crc32' procedure wrapped as above. Ignores 						the seed when 0.


File: hashes.egg.info,  Node: Hash Auxillary Procedures,  Next: Digest Procedures,  Prev: Hash Procedures,  Up: Documentation

2.2 Hash Auxillary Procedures
=============================

 -- parameter: current-hash-seed
          (current-hash-seed [NEW-SEED])

     Returns or sets the current default hash seed. The initial 					value
     is 0.

 -- procedure: make-seeded-hash
          (make-seeded-hash HASH-PROC [SEED])

     Returns a curried `HASH-PROC' of 1 or 2 arguments 					with the
     supplied `SEED'. When the seed is missing 					the
     `(current-hash-seed)' is assumed.

 -- procedure: make-range-hash
          (make-range-hash HASH-PROC UPPER [LOWER])

     Returns a `HASH-PROC' with the hash value 					restricted to
     the supplied exact interval, [`LOWER' `UPPER']. When `LOWER' is
     missing 0 is if (data == NULL) return initval.  					The signature is
     that of the `HASH-PROC'.

 -- procedure: make-real-hash
          (make-real-hash HASH-PROC)

     Returns a `HASH-PROC' with the hash value 					restricted to
     the interval, [0.0 1.0]. The signature is that 					of the `HASH-PROC'.

 -- procedure: make-range-restriction
          (make-range-restriction UPPER [LOWER])

     Returns a procedure of 1 argument, a number. The arguments 					will be
     swapped if necessary so the range is [`LOWER' 					`UPPER']. When
     `LOWER' missing 0 is 					assumed.


File: hashes.egg.info,  Node: Digest Procedures,  Next: Miscellaneous Procedures,  Prev: Hash Auxillary Procedures,  Up: Documentation

2.3 Digest Procedures
=====================

The acceptable input objects for the digest procedures are
strings, input-ports, byte-vectors, or anything that can be
converted to a byte-vector. See message-digest
(http://www.call-with-current-continuation.org/eggs/message-digest.html)
for more information.

   The HASH name below refers to one of the hash algorithm
symbols above.

 -- procedure: HASH:digest
          (HASH:digest OBJECT)

     Returns the HASH of `OBJECT' as a hex 					string.

 -- procedure: HASH:binary-digest
          (HASH:binary-digest OBJECT)

     Returns the HASH of `OBJECT' as a string.

 -- procedure: HASH:primitive
          (HASH:primitive)

     Returns the HASH primitive object.


File: hashes.egg.info,  Node: Miscellaneous Procedures,  Prev: Digest Procedures,  Up: Documentation

2.4 Miscellaneous Procedures
============================

 -- procedure: string-binary->unsigned-int32
          (string-binary->unsigned-int32 STRING)

     Returns the first 32-bits of `STRING' as an 					unsigned-int32, not
     guaranteed to be a fixnum.

 -- procedure: string-binary-unsigned-int32-set!
          (string-binary-unsigned-int32-set! STRING UNSIGNED_INT32)

     Sets the first 32-bits of `STRING' to `UNSIGNED_INT32'.

 -- constant: UNSIGNED-INT32-SIZE
     Sizeof unsigned-int32 in bytes.


File: hashes.egg.info,  Node: License,  Next: Index,  Prev: Documentation,  Up: Top

3 License
*********


Copyright (c) 2006, Kon Lovett.  All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the Software),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

Does not supercede any restrictions found in the source code.


File: hashes.egg.info,  Node: Index,  Prev: License,  Up: Top

Index
*****

 [index ]
* Menu:

* current-hash-seed:                     Hash Auxillary Procedures.
                                                               (line  7)
* HASH:                                  Hash Procedures.      (line 23)
* HASH-prim:                             Hash Procedures.      (line 18)
* HASH:binary-digest:                    Digest Procedures.    (line 21)
* HASH:digest:                           Digest Procedures.    (line 16)
* HASH:primitive:                        Digest Procedures.    (line 26)
* make-range-hash:                       Hash Auxillary Procedures.
                                                               (line 20)
* make-range-restriction:                Hash Auxillary Procedures.
                                                               (line 34)
* make-real-hash:                        Hash Auxillary Procedures.
                                                               (line 28)
* make-seeded-hash:                      Hash Auxillary Procedures.
                                                               (line 13)
* string-binary->unsigned-int32:         Miscellaneous Procedures.
                                                               (line  7)
* string-binary-unsigned-int32-set!:     Miscellaneous Procedures.
                                                               (line 13)
* UNSIGNED-INT32-SIZE:                   Miscellaneous Procedures.
                                                               (line 18)



Tag Table:
Node: Top232
Node: About this egg573
Node: Version history757
Node: Requirements1364
Node: Usage1611
Node: Documentation1770
Node: Hash Procedures2010
Node: Hash Auxillary Procedures5409
Node: Digest Procedures6819
Node: Miscellaneous Procedures7675
Node: License8292
Node: Index9538

End Tag Table
