Page 1 of 1

hashing encoded arrays?

Posted: Thu Mar 03, 2016 10:24 pm
by makeshyft
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

Re: hashing encoded arrays?

Posted: Thu Mar 03, 2016 11:44 pm
by FourthWorld
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.

Re: hashing encoded arrays?

Posted: Thu Mar 03, 2016 11:59 pm
by makeshyft
yeah...... that was my worry.

hmmmm.. not sure what to do to solve this. Thanks Richard

Re: hashing encoded arrays?

Posted: Fri Mar 04, 2016 2:14 am
by FourthWorld
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?

Re: hashing encoded arrays?

Posted: Fri Mar 04, 2016 3:27 am
by makeshyft
that seems like the only option ... thanks for your help.