Using Md5Digest on stacks loaded in memory

Dar Scott dsc at swcp.com
Sat Dec 25 11:59:35 EST 2004


Alejandro,
On Dec 25, 2004, at 6:08 AM, Alejandro Tejada wrote:

> But, it's possible to get a md5digest of a custom
> property that only exist in memory, because
> the stack has not been saved to disk yet.

Yes.  That value will be preserved through saving and opening.

> So it could exist some way to get the md5digest
> from a stack that exist only in memory
> (and still has not been saved to disk).

Even if you were to iterate through all properties, built-in and 
private, it won't be the same as that for the file.  The file will have 
other overhead.  That would be good check though.
>
> I believe that the engine uses a md5digest of
> the stack to ask the user if wants to save
> the stack loaded in memory before closing it.

I don't know about this one.  I know there have been attempts at that 
for the edited script.

I have no reason to think that the internal form of a stack resembles 
that of the stack file.

> I know about the secure mode, but it is a major
> blocker. The stack could not write a text file
> to disk or change the registry (all these
> restrictions are fine), but when i try to put
> text in the clipboard, to paste in another document
> the clipboard is always empty!?!?!?.
> I've tried this code, and many variations
> without success:
>
> set the clipboarddata to localVariableZXC
>
> I'll like to be wrong about this, and that even in
> secure mode, i could put data on the clipboard to
> paste in a text editor, like notepad, but in my
> side this is not possible or maybe i'm using the
> wrong code.

You might want to break this out into another query.  I'm not familiar 
with this.

>> Maybe you can create a small stack or plugin
>> whose sole purpose is to create the md5Digest of
>> stacks and related files.
>
> Looks like this is the solution,

Great!

> but this question
> still remains unanswered:
>
> How could the engine get the md5digest of a
> single part of a stack loaded in memory
> (a custom property) and not from the whole
> stack, that only exists in memory too????

 From our scripting we don't have access to that memory.  We have access 
to values which we can pull from properties.  In Transcript we are 
hidden from (protected from) those raw details.

I suppose it is possible for RunRev to make a function that does this, 
but it might have to save to a memory location and calculate on that.

The stack includes information such as the length of the value of 
properties as well as the length of their names.  It also has to 
associate properties with the right objects.  This is more than just 
the value of the properties.  At some point that needs to be organized 
as a sequence of bytes that the md5 needs.


I do think that some kind of signing or checking for revOnline would be 
great.  If added there, there might be some general IDE features added 
we can use.  That might check for the md5 of a downloaded stack (file 
image) before opening it.


Hey!  What are you doing working?  Don't you have festivities and/or 
worship to attend to on Christmas?  Oh, I better go, too.

Dar

**********************************************
     DSC (Dar Scott Consulting & Dar's Lab)
     http://www.swcp.com/dsc/
     Programming Services and Software
**********************************************



More information about the use-livecode mailing list