Retrieve MD5-hash in macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Retrieve MD5-hash in macro

Ingo Bartholomaeus
Hi,

is there a way (e.g. using eval()) to retrieve the MD5-hash (or SHA-1) of a given string using the macro language?

Regards,
Ingo
Reply | Threaded
Open this post in threaded view
|

Re: Retrieve MD5-hash in macro

Gluender-4
Ingo,

depending on your OS you may try use an UNIX shellscript (e.g.
md5sum) that you properly call by the IJ-macro routine:

        exec( "sh", "-c", YourShellScriptCommand );

See IJ-macro examples "ExecExamples.txt".


>Hi,
>
>is there a way (e.g. using eval()) to retrieve the MD5-hash (or
>SHA-1) of a given string using the macro language?
>
>Regards,
>Ingo

HTH
--

                   Herbie

          ------------------------
          <http://www.gluender.de>
Reply | Threaded
Open this post in threaded view
|

Re: Retrieve MD5-hash in macro

dscho
In reply to this post by Ingo Bartholomaeus
Hi,

On Sat, 29 Jan 2011, Ingo Bartholomaeus wrote:

> is there a way (e.g. using eval()) to retrieve the MD5-hash (or SHA-1)
> of a given string using the macro language?

You have two options: resort to Javascript and using
java.security.MessageDigest or reimplementing the algorithm in the macro
language (e.g. by converting a Javascript implementation like this:
http://www.movable-type.co.uk/scripts/sha1.html).

Ciao,
Johannes