comp.lang.ada
 help / color / mirror / Atom feed
* Hashing Function wanted
@ 1988-02-23 15:43 "EDWARD CRAGG"
  1988-02-27  0:07 ` Dave Jones
  1988-02-29 21:29 ` R.A. Agnew
  0 siblings, 2 replies; 3+ messages in thread
From: "EDWARD CRAGG" @ 1988-02-23 15:43 UTC (permalink / 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
------

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1988-02-29 21:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1988-02-23 15:43 Hashing Function wanted "EDWARD CRAGG"
1988-02-27  0:07 ` Dave Jones
1988-02-29 21:29 ` R.A. Agnew

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