aboutsummaryrefslogtreecommitdiff
path: root/md5sum.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-04-14 03:33:33 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-04-14 03:33:33 +0000
commitaf79176198d64feb4b1791b4b2f7c1a36896403f (patch)
treee382ce1e89670e5079d30fb03b8e1a455fdefee1 /md5sum.c
parentc178b3b7f3a676d7cb08104d51d5ebd0233ea6cb (diff)
downloadbusybox-w32-af79176198d64feb4b1791b4b2f7c1a36896403f.tar.gz
busybox-w32-af79176198d64feb4b1791b4b2f7c1a36896403f.tar.bz2
busybox-w32-af79176198d64feb4b1791b4b2f7c1a36896403f.zip
Handle endian-ness. Patch from Paul J.Y. Lahaie <pjlahaie@linuxcare.com>
-Erik git-svn-id: svn://busybox.net/trunk/busybox@2344 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--md5sum.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/md5sum.c b/md5sum.c
index ac3462334..a9bbdef36 100644
--- a/md5sum.c
+++ b/md5sum.c
@@ -181,7 +181,14 @@ extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
181//--------end of md5.h 181//--------end of md5.h
182//---------------------------------------------------------------------------- 182//----------------------------------------------------------------------------
183 183
184#define SWAP(n) (n) 184/* Handle endian-ness */
185#if __BYTE_ORDER == __LITTLE_ENDIAN
186 #define SWAP(n) (n)
187#else
188 #define SWAP(n) ((n << 24) | ((n&65280)<<8) | ((n&16711680)>>8) | (n>>24))
189#endif
190
191
185 192
186/* This array contains the bytes used to pad the buffer to the next 193/* This array contains the bytes used to pad the buffer to the next
187 64-byte boundary. (RFC 1321, 3.1: Step 1) */ 194 64-byte boundary. (RFC 1321, 3.1: Step 1) */