MD5

"Christian Haider" <[email protected]> Mon, 4 Dec 2023 18:52:10 +0100
Newsgroups gmane.comp.lang.smalltalk.vwnc
Message-ID <[email protected]>
Hi,

 

MD5 is a relatively simple hashing algorithm used in many places.

Often, small strings are hashed (like passwords or, in my case, to get an ID
for a PDF) where performance is not so important.

For file checksums, performance is more important.

 

Up to now, I used the MD5 function from VisualWorks (parcel MD5) without any
problem on windows.

The new VW 9.3 relies fully on the crypto libraries of the platform which
makes it incompatible with earlier versions I want to support. Additionally,
there is a lot of confusion about how to setup the required libraries under
linux and mac (I couldn't get it to work properly).

 

Therefore, I implemented MD5 myself to free the PDFtalk library from this
dependency. There is also another implementation in the PostgreSQL library
MD5Hash in [PostgreSQL3EXDI]. But this is also a dependency I don't want for
the library.

 

The implementation is done and works fast enough (about the same performance
as MD5Hash). Fun fact: both in-image implementations are much faster than
the host library implementation - for small strings. For large strings, the
OS is faster by magnitudes.

 

Now the question: shall I just keep it private as part of PDFtalk or would
it be useful as stand-alone package for others?

 

The class name may be MD5 in namespace Smalltalk. There are existing
Security.MD5 (host impl.) and Security.MD5Hash (PostgreSQL) classes.

The package could be named 'MD5 stand-alone' and has SecurityBase as
prerequisite.

 

What do you think? Is it worth it?

 

Cheers,

Christian