Problem description
Creating an md5sum of a text-like file that does not conform exactly to UTF-8 produces a different hash from mac or linux systems, reducing its use as file validation.
Steps to reproduce
Mac and Ubuntu systems both give the following MD5 sum for the attached file:
MD5 (init5.js) = 693e9af84d3dfcc71e640e005bdc5e2e
using the following titanium code:
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
win.addEventListener('click', function() {
var file = Titanium.Filesystem.getFile("init5.js");
var blob = file.read();
var md5sum = Titanium.Utils.md5HexDigest(blob);
Ti.API.info("md5 is " + md5sum);
alert(md5sum);
});
win.open();
produces a different MD5 output (on both Android and iOS) = d41d8cd98f00b204e9800998ecf8427e , different from the one generated from Mac OS X or Ubuntu Linux
When I initially reported this issue I suggested an easy fix. Is there an expected version of the SDK that will include this easy fix?