Hi,

I answer myself...

If fix the issue by patching MD5.as by removing UTF8 encoding like this :

        /*
        * Encode a string as utf-8
        */
        private static function str2rstrUTF8 (input:String):String
        {
            return input;
            //return unescape(encodeURIComponent(input));
        }

Le 2023-07-12 13:24, cont...@cristallium.com a écrit :

Hi,

Here is one test file of 1 octet (0xc0 ie 192 in decimal) inside.

When using md5sum (on linux) of this file the result is 4843a4868714fa7589e8ef87756bcacf

But when I do this :

import org.apache.royale.utils.MD5;

var test:BinaryData =  new BinaryData([0xc0]); //À

trace("->" + MD5.hash( test.toString()));
->9b759040321a408a5c7768b4511287a6

OR

trace ("->" + MD5.hash(String.fromCharCode(192) );
->d7a85d72b605f8d061a5200e12a838c7

Could you tell me what I do wrong ? Certainly an issue with unicode or UTF8, but I tried many converts I didn't get the right result (4843a4868714fa7589e8ef87756bcacf)

Fred

--

Reply via email to