Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

MD5 Hash in Fortran revisit


In case anyone is trying to use the code from this forum post:

I wanted to let folks know that there was a bug I fixed that might be helpful to someone in the future.

I changed this line of code:

character*((int(len(string)/64)+1)*64) newString


character*((int((len(string)+8)/64)+1)*64) newString

The inclusion of the "+8" allows for the 8 bit length portion of the MD5 padding spec to be accounted for and prevent string overflows for strings that need fewer than 8 bits of padding.

Not that this code is being used many places....I just recently used it and had to debug/fix the issue so figured I'd post about it just in case.

0 Replies