hashing encoded arrays?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

hashing encoded arrays?

Post by makeshyft » Thu Mar 03, 2016 10:24 pm

Hi there.

lets say I encode an array full of data and then get a hash of it ..... given the identical set of keys and data...am i guaranteed the same hash on every platform? or is ordering something I need to consider? ... I MUST guarantee the same hash........or is this a bad idea?

Thanks

Tom
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: hashing encoded arrays?

Post by FourthWorld » Thu Mar 03, 2016 11:44 pm

Assuming you're using LC's built-in hash functions, the hash should be the same on the same data. But as far as creating that data from an array, I wouldn't count on the serialized form of an array remaining the same across platforms or possibly even across sessions on the same platform.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: hashing encoded arrays?

Post by makeshyft » Thu Mar 03, 2016 11:59 pm

yeah...... that was my worry.

hmmmm.. not sure what to do to solve this. Thanks Richard
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: hashing encoded arrays?

Post by FourthWorld » Fri Mar 04, 2016 2:14 am

An array only lives in the current session anyway. Maybe you could create the hash from the data used to populate the array, or save the serialized form?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: hashing encoded arrays?

Post by makeshyft » Fri Mar 04, 2016 3:27 am

that seems like the only option ... thanks for your help.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Post Reply