comp.lang.ada
 help / color / mirror / Atom feed
From: ecragg@GMUVAX.GMU.EDU ("EDWARD CRAGG")
Subject: Hashing Function wanted
Date: 23 Feb 88 15:43:00 GMT	[thread overview]
Message-ID: <8802231548.AA16212@ajpo.sei.cmu.edu> (raw)

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
------

             reply	other threads:[~1988-02-23 15:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-02-23 15:43 "EDWARD CRAGG" [this message]
1988-02-27  0:07 ` Hashing Function wanted Dave Jones
1988-02-29 21:29 ` R.A. Agnew
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox