From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_05,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!uunet!husc6!hao!ames!pasteur!ucbvax!GMUVAX.GMU.EDU!ecragg From: ecragg@GMUVAX.GMU.EDU ("EDWARD CRAGG") Newsgroups: comp.lang.ada Subject: Hashing Function wanted Message-ID: <8802231548.AA16212@ajpo.sei.cmu.edu> Date: 23 Feb 88 15:43:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: "EDWARD CRAGG" Organization: The Internet List-Id: Does anyone have either ideas or experience related to a hashing function in Ada for converting a string of unspecified length (probably less than 256) to an integer that doesn't eat you alive trying to get around all the type checking? Ideally I would like to use something like the old Fortran trick of equivalencing the string to an LOGICAL*4, XORing the component 4 byte units, and taking the absolute value of the result as an integer to be divided by the table size to give the hash code as the remainder. However the type conversion using attributes (to keep totaly machine independent) is eating me alive. Does anybody know what kind of hashing function the compiler writers are using? (Or is that the real reason Ada compilers are so slow :-) ------------------------------------------------------------------- Edward E Cragg Bitnet: ECRAGG@GMUVAX Internet: ECRAGG@GMUVAX.GMU.EDU ------