[Toybox] Add new toy - md5sum

Rob Landley rob at landley.net
Fri Mar 9 06:34:21 PST 2012


On 03/09/2012 05:15 AM, Georgi Chorbadzhiyski wrote:
> The code is based on public domain md5 code the toybox stuff is copied
> from sha1sum. I'm not entirely happy about byteReverse() func.

At this point I'm just going to have to spend another weekend catching
up, but before I head off to work lemme point you at the SWAP_*() macros
out of lib/portability.h.

Basically a name like SWAP_LE32() means "this is stored as a little
endian 32 bit value, perform the translation to/from whatever the native
32-bit format is".  So you do the swap once on the way in, and once on
the way out.

If you're _on_ a little endian format, the macro is a NOP.  There are
16, 32, and 64 bit versions of BE and LE.  In each case, the name of the
macro refers to the _external_ representation, and converts to/from
whatever your native representation happens to be (which can vary
depending on what you're currently compiling for).

I should add this to code.html...

Rob



More information about the Toybox mailing list