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
Android MD5 sum : d41d8cd98f00b204e9800998ecf8427e, but it shows error on iphone emulator(see screen shot). Attached code(init5.js) is empty
Tried with 3.2.0, cannot reproduce.
Closing ticket as I am unable to reproduce this issue with the following environment; Pixel (7.1) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80