Re: md5Digest gives different results Mac vs Windows LC 9.5.1

2020-04-19 Thread Monte Goulding via use-livecode
Hi Bill

As Brian said LiveCode is not calculating different values on different 
platforms. You can’t just look at the output in a text field and compare 
though. The function returns binary data so needs to be hex encoded for cross 
platform comparison. If you put it into a field then LiveCode will do its 
normal binary data to string conversion which uses a different text encoding on 
each platform so it will look different in the field.

To compare cross platform use:
get binaryDecode("h*", messageDigest(textEncode("My very large data", "UTF-8"), 
"SHA3-256"), tHash); put tHash

Cheers

Monte

> On 20 Apr 2020, at 10:14 am, Bill Vlahos via use-livecode 
>  wrote:
> 
> The LiveCode Dictionary states:
> When generating a messageDigest for a string, it is a good idea to encode it 
> to binary data using the textEncode <> function. Otherwise, the messageDigest 
> could be different, depending on the platform <> on which your application is 
> running.
> 
> However, I tried their example in the Dictionary but it still gives different 
> values on Macintosh vs. Windows:
> put textEncode("My very large data", "UTF-8") into tOriginal
> put messageDigest(tOriginal, "SHA3-256") into tChecksum
> 
> Why would the platform calculate the hashes differently?
> Why did older versions of LiveCode calculate it the same?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: md5Digest gives different results Mac vs Windows LC 9.5.1

2020-04-19 Thread Bill Vlahos via use-livecode
The LiveCode Dictionary states:
When generating a messageDigest for a string, it is a good idea to encode it to 
binary data using the textEncode <> function. Otherwise, the messageDigest 
could be different, depending on the platform <> on which your application is 
running.

However, I tried their example in the Dictionary but it still gives different 
values on Macintosh vs. Windows:
put textEncode("My very large data", "UTF-8") into tOriginal
put messageDigest(tOriginal, "SHA3-256") into tChecksum

Why would the platform calculate the hashes differently?
Why did older versions of LiveCode calculate it the same?

Regards,
Bill Vlahos

> On Apr 19, 2020, at 2:15 PM, Brian Milby via use-livecode 
>  wrote:
> 
> Try this:
> 
> put 0 into x;put binaryDecode("h32",the md5digest of "LiveCode",x);put x
> 
> You will get the same on both platforms.
> 
> On Sun, Apr 19, 2020 at 5:13 PM Bill Vlahos via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Well earlier versions of LiveCode gave the same results on Mac and Windows.
>> 
>> Bill
>> 
>>> On Apr 19, 2020, at 1:51 PM, matthias rebbe via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> I think this is, because Mac uses Mac Roman and Windows ISO encoding.
>>> 
>>> Or am i wrong?
>>> 
>>> -
>>> Matthias Rebbe
>>> Life Is Too Short For Boring Code
>>> 
 Am 19.04.2020 um 22:34 schrieb Bill Vlahos via use-livecode <
>> use-livecode@lists.runrev.com>:
 
 Before I report this as a bug, please confirm I’m not doing something
>> stupid.
 
 LiveCode 9.5.1 Indy
 
 In the message box put the following:
 put the md5Digest of "LiveCode"
 
 
 I get the expected result on Macintosh but a different result on
>> Windows.
 
 Thank you,
 Bill Vlahos
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: md5Digest gives different results Mac vs Windows LC 9.5.1

2020-04-19 Thread Brian Milby via use-livecode
Try this:

put 0 into x;put binaryDecode("h32",the md5digest of "LiveCode",x);put x

You will get the same on both platforms.

On Sun, Apr 19, 2020 at 5:13 PM Bill Vlahos via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Well earlier versions of LiveCode gave the same results on Mac and Windows.
>
> Bill
>
> > On Apr 19, 2020, at 1:51 PM, matthias rebbe via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > I think this is, because Mac uses Mac Roman and Windows ISO encoding.
> >
> > Or am i wrong?
> >
> > -
> > Matthias Rebbe
> > Life Is Too Short For Boring Code
> >
> >> Am 19.04.2020 um 22:34 schrieb Bill Vlahos via use-livecode <
> use-livecode@lists.runrev.com>:
> >>
> >> Before I report this as a bug, please confirm I’m not doing something
> stupid.
> >>
> >> LiveCode 9.5.1 Indy
> >>
> >> In the message box put the following:
> >> put the md5Digest of "LiveCode"
> >>
> >>
> >> I get the expected result on Macintosh but a different result on
> Windows.
> >>
> >> Thank you,
> >> Bill Vlahos
> >> ___
> >> use-livecode mailing list
> >> use-livecode@lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: md5Digest gives different results Mac vs Windows LC 9.5.1

2020-04-19 Thread Bill Vlahos via use-livecode
Well earlier versions of LiveCode gave the same results on Mac and Windows.

Bill

> On Apr 19, 2020, at 1:51 PM, matthias rebbe via use-livecode 
>  wrote:
> 
> I think this is, because Mac uses Mac Roman and Windows ISO encoding.
> 
> Or am i wrong?
> 
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
> 
>> Am 19.04.2020 um 22:34 schrieb Bill Vlahos via use-livecode 
>> :
>> 
>> Before I report this as a bug, please confirm I’m not doing something stupid.
>> 
>> LiveCode 9.5.1 Indy
>> 
>> In the message box put the following:
>> put the md5Digest of "LiveCode"
>> 
>> 
>> I get the expected result on Macintosh but a different result on Windows.
>> 
>> Thank you,
>> Bill Vlahos
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: md5Digest gives different results Mac vs Windows LC 9.5.1

2020-04-19 Thread matthias rebbe via use-livecode
I think this is, because Mac uses Mac Roman and Windows ISO encoding.

Or am i wrong?

-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 19.04.2020 um 22:34 schrieb Bill Vlahos via use-livecode 
> :
> 
> Before I report this as a bug, please confirm I’m not doing something stupid.
> 
> LiveCode 9.5.1 Indy
> 
> In the message box put the following:
> put the md5Digest of "LiveCode"
> 
> 
> I get the expected result on Macintosh but a different result on Windows.
> 
> Thank you,
> Bill Vlahos
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode