Question

I want to generate a MD5 checksum of a string (stored as a property value) and store it in other property to be used later in the script.

The only way I have found is to generate a file with the string, generate the MD5 of this file (with checksum task) and then delete the file.

Is there a better way to do it?


For example what I have done is:

<echo file="${tmpFile}">Datos20140306_${info.A}_${info.B}</echo>
<checksum file="${tmpFile}" property="info.md5" />
<delete file="${tmpFile}" />
<echo>Hash: ${info.md5}</echo>
Était-ce utile?

La solution

Looking at the Ant documentation (1.9) for <checksum>, it looks like that is the only way. Don't see a way to go straight to a property.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top