macrosmd5openoffice-basic

How do I calculate the md5 checksum of a string in starbasic macro (openoffice macro)?


I am trying to make an OpenOfficeWriter StarBasic-Macro Program, that turns wiki source code to Open office Writer. I need a starbasic macro, that generates the MD5 checksum. There is a MD5Thumbprint in the Documentation for OpenOffice, so I suppose you can compute the MD5 in a Open Office starbasic macro using some kind of macro code. This is what I'm looking for.

I suppose I have to use the XCertificate Interface in the security module, but I don't know how the macro code should be. So I need a Open Office starbasic macro command or code like: stringMD5=s.md5(), where will be a string (for example something like "Douglas C-47 Skytrain.jpg") and stringMD5 should be a string or something that I can make to a string (in this example the outcome in the end should be the string "40decfb5f1be8bca1e56c8a853027941", which is the MD5 for the String "Douglas C-47 Skytrain.jpg").

I would like to avoid using Python (see:How to get MD5 sum of a string?) and create a starbasic macro instead. If somebody has a tip, I will be of course very glad. George


Solution

  • The cryptographic extension seems to do what you want. However it may not work in recent versions of OpenOffice.

    Otherwise, write the macro in a language such as Python or Java that can compute MD5 using a library.

    Related: https://forum.openoffice.org/en/forum/viewtopic.php?f=5&p=391985