From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,1de6257d3e8a8ddb X-Google-Attributes: gidfee84,public From: donn@u.washington.edu (Donn Cave) Subject: Re: MD5 implementation Date: 1996/01/12 Message-ID: #1/1 X-Deja-AN: 135268131 distribution: world references: <30F4CCAF.41C6@adv.magwien.gv.at> <4d3usa$gfm@nntpd2.cxo.dec.com> organization: University of Washington newsgroups: comp.unix.osf.osf1 In article <4d3usa$gfm@nntpd2.cxo.dec.com>, spratte@odette.cxo.dec.com (Michael Spratte) wrote: ... | I've had no problem with the RFC1321 code running on Digital UNIX. All | I did was modify global.h: | | /* UINT4 defines a four byte word */ | #if defined(__osf__) && defined(__alpha) | typedef unsigned int UINT4; | #else | typedef unsigned long int UINT4; | #endif | | With this modification, the code works identically on ULTRIX, OpenVMS, | Digital UNIX, and Windows NT. That's about the same as what I proposed to the author of Python*, and it turns out there was already a slightly more elegant solution based on the symbols LONG_BIT and WORD_BIT, in sys/limits.h. These symbols evidently are intended to expose the size in bits of "long int" and "int" respectively. So the following works not only on the Alpha, but also on 64-bit MIPS hardware etc., as long as there's a sys/limits.h and it has these symbols, which is true at least on several UNIX platforms. #include #if WORD_BIT == 32 typedef unsigned int UINT4; #else # if LONG_BIT == 32 typedef unsigned long int UINT4; # else what have we here # endif #endif Donn Cave, University Computing Services, University of Washington donn@u.washington.edu * Python is an interpreted language; it incorporates this code in its MD5 support module. Direct your browser to http://www.python.org.