I had posted a note here:
http://thedambook.com/smf/index.php?topic=2650.msg17619#msg17619regarding a technique for calculating MD5 hash values for a file. There I was using fciv.exe (a Windows utility from Microsoft), run as a shell process from the script, something like:
Set execObj = WshShell.Exec("fciv -wp """ & item.path & """")
I finally learned enough COM Automation to write a component that can be loaded directly from the script. So I can now do this (in vbscript):
Dim md5, val
Set md5 = CreateObject("MJH.MakeMD5")
val = md5.CalculateMD5(item.path)
which returns a BSTR representing the 32 hex characters of the MD5 value. It would work the same in j(ava)script:
var md5 = new ActiveXObject("MJH.MakeMD5");
var val = md5.CalculateMD5(item.path);
For those of you using xMedia (really, any scriptable image browser or asset management tool), you could use this to set the value of a custom field when you populate the catalog, and then later compare the current MD5 hash of a file to the value you've stored in the catalog, to determine whether the file has been modified (say, because of degradation of the media).
Cheers,
Matt