comp.lang.ada
 help / color / mirror / Atom feed
* Binary files vs Portablity vs Ada
@ 1999-11-04  0:00 John Halleck
  1999-11-05  0:00 ` Robert Dewar
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: John Halleck @ 1999-11-04  0:00 UTC (permalink / raw)


Background:

  At one time I wrote a version of the Standard Hash Algorithm (SHA, 
  it went with the old government Digital Signature Standard)
  which I wrote in C...

  Lately, because GNAT is now around, I've hauled it out again,
  and redid it in Ada.  I then used it as an example for a coworker
  as to how you can be portable in Ada.

  The actual algorithm is defined for a bit stream, although almost
  everyone implements it for bits in byte size chunks. (As I did)
  Because of this, any file should be Hashable, even on machines
  with perverse word and byte sizes. 

Question:

  Is there even a portable way to get the "raw" bits for a file that
  works on all machines supporting Ada?  (So that it can be handed
  to a bit oriented version of SHA.)

  It is not hard to do something that just grabs bytes from a file
  until done, but that assumes the file is some multiple of eight
  bits long, and that all data for the file is in the bytes returned.
  On machines like the Sperry 1100 series, the native word size is
  36 bits (Usually chopped into four nine-bit bytes for Text use)
  And the file is "control word -> image"  instead of "embeded
  control."

  Can this be done portabily?  (I suspect not, but I'm not an Ada
  expert.)  I have something that seems to work for PC's, Mac's, 
  and Unix boxes, but it bugs me that I don't know how to do it in
  any general way.




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

end of thread, other threads:[~1999-11-10  0:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-04  0:00 Binary files vs Portablity vs Ada John Halleck
1999-11-05  0:00 ` Robert Dewar
1999-11-05  0:00   ` Ted Dennison
1999-11-06  0:00     ` Robert Dewar
1999-11-08  0:00       ` Ted Dennison
1999-11-08  0:00         ` Tucker Taft
1999-11-09  0:00           ` Robert Dewar
1999-11-09  0:00         ` Robert A Duff
1999-11-09  0:00           ` Advice, or *Advice*? (was: Binary files vs Portablity vs Ada) Ted Dennison
1999-11-10  0:00             ` Robert A Duff
1999-11-09  0:00         ` Binary files vs Portablity vs Ada Robert Dewar
1999-11-05  0:00 ` Larry Kilgallen
1999-11-05  0:00   ` John Halleck
1999-11-05  0:00 ` Matthew Heaney
1999-11-08  0:00 ` Nick Roberts
1999-11-09  0:00   ` Ted Dennison
1999-11-09  0:00   ` Robert Dewar

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