I’m using this implementation of SHA1 in C. Works fine on Windows but it does not output correct hashes on Unix (tried it on Ubuntu and Mac OS 10.8). Furthermore, on Ubuntu it outputs different hash from the same message.
I guess I could use another implementation, just curious why that happens.
EDIT
Thanks, you guys are right. Changed it to
typedef unsigned int UINT4;
seems to work fine.
Are these 64bit unix’es?
will actually be 8 bytes on 64 bit Linux (but 4 bytes on 64 bit Windows)
https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models