object checkSum?

Chipp Walters chipp at chipp.com
Wed Jul 6 21:12:05 EDT 2005


Here's what I've got so far..any suggestions?
X, I'm not so sure about size, as it makes it necessary to write out a 
file, which certainly must take more time than MD5digest?



function altObjChecksum pObjID
   --> THIS CREATES A CHECKSUM FOR RR OBJECTS
   --> IT INCLUDES PROPERTIES, SCRIPTS AND CUSTOMPROP SETS AND THEIR 
CUSTOM PROP VALUES

   --> PROPERTIES OF OBJECT
   put the properties of pObjID into tData

   --> THESE NECESSARY AS THEY CHANGE FROM STACK TO STACK
   --> ANYONE THINK OF ANY OTHERS WHICH MIGHT CHANGE?? TIA!!
   put "" into tData["id"]
   put "" into tData["visited"]
   put "" into tData["layer"]

   combine tData using cr and ":"

   --> SCRIPT OF OBJECT
   put cr & the script of pObjID after tData

   --> CUSTOM PROP SETS AND CUSTOM PROPS
   put the customPropertySets of pObjID into tCPlist

   repeat for each line L in tCPlist
     --> NO NEED TO 'MATCH' REV'S IDE PROPS
     if L is "cRevGeneral" then next repeat

     put the customProperties[L] of pObjID into tKeys
     combine tKeys using cr and ":"
     put cr & L & cr & tKeys after tData
   end repeat

   return URLencode(md5digest(tData))

end altObjChecksum


Richard Gaskin wrote:
> Chipp Walters wrote:
> 
>> Short of MD5digesting the concatenation of all properties, scripts, 
>> custom props and propsets of an object, *OR* MD5digesting a single 
>> stack file with a specified object copied to it and saved locally...
>>
>> Is there an *easier* way to create a checkSum for a single RR object 
>> that I'm missing?
> 
> 
> I had a similar need recently, and decided to go with the MD5 of the 
> props and custom props (the objects I was working on have no scripts). 
> If there's a better way I'd love to learn it, but for the moment the 
> MD5/props route works pretty well.
> 



More information about the use-livecode mailing list