[TIMOB-2625] uft-8 to utf-16 string conversions cause incorrect Ti.Utils md5HexDigest and base64*code results
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-06-09T16:54:53.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, utils |
Reporter | Paul Dowsett |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:25:10.000+0000 |
Updated | 2017-06-09T16:54:53.000+0000 |
Description
See title. Already discussed with Don and Marshall.
Tested on Android only, Ti SDK 1.5.X (17th Dec 2010) and 1.6 (19th
Dec 2010).
To test the issue:
var fileContents = thisFile.read().toString();
var md5File = Ti.Utils.md5HexDigest(fileContents);
Ti.API.info('file md5 = '+md5File);
Note that the md5 of a string is correct, as the following
shows:
var md5 = Ti.Utils.md5HexDigest("thisisatest");
Ti.API.info('md5 = '+md5);
returns different results to the following (on linux system):
printf thisisatest | md5sum
Both return f830f69d23b8224b512a0dc2f5aec974
Closing ticket due to time passed, any problems please open a new ticket.