Skip to main content

IBM Systems  >   z Systems  >   z/VM  >  

Description of HASHWF

Download count: 19 this month, 6431 altogether.

Downloads for HASHWF:
VMARC archive: v-28K
zip archive: z-17K

 
**********************  UNCLASSIFIED  **********************************
* :nick.HASHWF     :sec.UNCLASSIFIED                  :disk.IBMVMGAT
* :title.A General HASH function (S/370 and other systems)
* :version.2.0     :date.95/03/11   :summary.ANNOUNCE :support.X
* :oname.Bill Fenlason              :onode.PK705VMA   :ouser.BILLFEN
* :aname.Bill Fenlason              :anode.PK705VMA   :auser.BILLFEN
* :ops.VM, MVS, AIX, others         :lang.ASM, C      :source.Y
* :doc.ANNOUNCE
* :kwd.HASH RANDOM REXX
* :abs.A simple high quality HASH function with good performance.
* Includes 370/Asm, C/370 and C/AIX source and a VM/REXX interface.
* :lic.By placing material on this conference, I agree to grant
* IBM a non-exclusive, royalty-free license for the material
* as set forth in the LICENSE AGREEMNT file on this conference.
************************************************************************
*
*  (c) Copyright International Business Machines Corporation 1993, 1995.
*                     All Rights Reserved.
*
*    This tool has been authorized for distribution to external users.
*    The terms and conditions are in the package LICENSE file.
*
*    A statement by the author is contained in the package ABOUT file.
*
************************************************************************
      HASHWF   ABOUT    *  Author ID and statement
*
* Documentation is contained in the source files (Assembler and C),
* and in the ANNOUNCE file.
*
      HASHWF   ANNOUNCE *  Description
*
* Calling sequence (standard calling conventions)
*   Parm 1: Byte string to be hashed
*   Parm 2: Integer (fullword) - byte string length
*   Parm 3: Integer (fullword) - Returned hash value (0 to 2**31-1)
*
* Uses 6 or 7 machine instructions per byte.
*
      HASHWF   ASSEMBLE *  Assembler source, documentation
      HASHWF   TEXT     *  Text (Assembler object) deck
*
* REXX interface providing a REXX HASH function.
*
* Example:  n = hash(string, table_size);
*
* The first argument is any string.  The second argument is the size of
* the hash table.  The result will be from 1 to the size.  If the second
* argument is omitted, the returned value will be from 0 to (2**31)-1.
*
* NOTE: if the text decks are loaded and a new module is generated by
* using GENMOD, be sure to specify the RLDSAVE option for LOAD.
*
      RXHASH   ASSEMBLE *  REXX interface assembler source
      RXHASH   TEXT     *  REXX interface object deck
      RXHASH   MODULE   *  REXX interface module
*
* C source version
*
* Function invocation (common C conventions)
*   Parm:    Char string to be hashed, terminated by a X'00' byte.
*   Returns: Long Int (fullword) - Hash value (0 to 2**31-1)
*
* No object deck for the C source is provided
*
      HASHWF   C        *  C/370 Source version
*
* The RISC/6000 version is a good performance (8 cycle loop) version.
* It includes ASCII case folding to allow insensitive searchs on a
* single hash chain.  Parms: string, length.  Result same as above.
*
      HASHWF   C6000    *  RISC/6000 AIX version
*