Subject: Re: hton64
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 06/30/1997 11:10:33
>> better yet: create generic byte-in-Nbyteinteger swap functions.
>> Then define ntoh* and hton* to use them, if appropriate for the
>> port.
> Hear. Hear.
Me too. (No, I'm not sending this from AOL! :-)
> Think of MD5 needing to byte swap on big-endian platforms.
...huh? When I did my MD5 stuff, I didn't see anything that needed
byte-swapping on big-endian hardware. Closest thing I see is that on a
little-endian machine some of the buffer-filling code amounts to a
bcopy. Not something I would recommend relying on; there's no need to
optimize to that extent - and indeed, my MD5 code doesn't care whether
it's on big-endian or little-endian or even PDP-endian hardware. As
long as it has some unsigned integral datatype of at least 32 bits (and
8-bit unsigned chars, actually), it should be fine.
der Mouse
mouse@rodents.montreal.qc.ca
7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B