On Aug 7, 9:37 pm, "Álvaro G. Vicario"
<webmasterNOSPAMTHA...@demogracia.comwrote:
*** la...@portcommodore.com escribió/wrote (Thu, 7 Aug 2008 11:10:08 -0700
(PDT)):
I would like to generate a checksum for a small array of floating
point numbers (to see if there was a change in or not in the array,
without having to have all the original values in a form.) some sort
of CRC would be nice.
Any know of any sample code or suggestions?
You can use serialize() on the array to get a string and then apply a
hashing function like md5(), sha1() or crc32().
--
--http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:http://bits.demogracia.com
-- Mi web de humor en cubitos:http://www.demogracia.com
--
But floating point numbers change slightly when their representation
is altered; you can't assume that if x=1.0000000000000/3.000000000000
then 3.0000000000000*x = 3.0000000000000000
So the solution needs to take into account what the meaning of
'change' is.
C.