Re: MD5 [was: Re: BinaryData and odd bytes]

2018-06-24 Thread Harbs
I hear you, but I’m out of my element here. I’m not even sure how to write meaningful tests on this. Thanks, Harbs > On Jun 24, 2018, at 10:54 AM, Alex Harui wrote: > > > > On 6/23/18, 12:15 PM, "Harbs" wrote: > >> >> We may need to understand which modern browsers that we support

Re: MD5 [was: Re: BinaryData and odd bytes]

2018-06-24 Thread Alex Harui
On 6/23/18, 12:15 PM, "Harbs" wrote: > > We may need to understand which modern browsers that we support (IE11, Chrome, FireFox, Android, IOS Safari) might have these issues. We might have to generate a "safeAdd()" instead of just "+" when we know the types are all integers. And

Re: MD5 [was: Re: BinaryData and odd bytes]

2018-06-23 Thread Harbs
> On Jun 23, 2018, at 7:45 AM, Alex Harui wrote: > > Thanks for digging into it. > > If I understand correctly, the AS code had a bug and should not have had the > s[] code in it. Correct. > The JS problem is interesting. Some internet articles claim that JS does not > have integers at

Re: MD5 [was: Re: BinaryData and odd bytes]

2018-06-22 Thread Alex Harui
Thanks for digging into it. If I understand correctly, the AS code had a bug and should not have had the s[] code in it. The JS problem is interesting. Some internet articles claim that JS does not have integers at all. So not sure what to make of the article you linked to. The code in the

Re: MD5 [was: Re: BinaryData and odd bytes]

2018-06-22 Thread Harbs
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

Re: MD5 [was: Re: BinaryData and odd bytes]

2018-06-22 Thread Alex Harui
On 6/21/18, 11:20 AM, "Harbs" 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

Re: MD5 [was: Re: BinaryData and odd bytes]

2018-06-21 Thread Alex Harui
Hmm. So are you saying the original code works in SWF but not when transpiled to JS and run in the browser? We might need to understand why and change the compiler output and/or document how to write AS that can transpile correctly. FWIW, the Ant_On_AIR library has a custom MD5 algorithm that

MD5 [was: Re: BinaryData and odd bytes]

2018-06-21 Thread Harbs
I forgot. The ported MD5 code did not work. I just replaced it with an MIT JS implementation… > On Jun 21, 2018, at 1:20 AM, Harbs wrote: > > FYI, the MD5 test there now fails. I have no idea why. Maybe I messed > something up with my BinaryData changes, but I can’t see what…