royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject Re: MD5 [was: Re: BinaryData and odd bytes]
Date Fri, 22 Jun 2018 10:20:56 GMT
In Flash, the error is ReferenceError: Error: 1069.

I took another look and it looks like the problem is the bracketed access to the BinaryData.

The code s[ i / 8 ] needs to be changed to either s.readByteAt(i/8) or s.array[i/8].

Making either of these changes fixed the Flash error, but did not fix the JS error:
expected 80338e79d2ca9b9c090ebaaa2ef293c7 but was: 996f93cb21f81b54962909fd0ea18074

I’m guessing that the problem is related to the comment here in the JS MD5 implementation:

		* Add integers, wrapping at 2^32. This uses 16-bit operations internally
		* to work around bugs in some JS interpreters.

I think part of the problem is that JS only has 32 bit ints. I did not follow this article
completely, but this might shed some light:
http://blog.vjeux.com/2013/javascript/conversion-from-uint8-to-int8-x-24.html <http://blog.vjeux.com/2013/javascript/conversion-from-uint8-to-int8-x-24.html>

Harbs

> On Jun 22, 2018, at 9:22 AM, Alex Harui <aharui@adobe.com.INVALID> wrote:
> 
> On 6/21/18, 11:20 AM, "Harbs" <harbs.lists@gmail.com> wrote:
> 
>    The MD5 test actually failed in Flash too. Although the error was different.
> 
>    I’m not sure why it was failing. I’m pretty sure the code was the same as the
Flex version with ByteArray swapped for BinaryData.
> 
> Even more bothersome.  We really should dig deeper on this.  We can't have other people's
business logic have similar issues.  Any volunteers?
> 
> -Alex
> 
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message