Checksummming in scripts

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Checksummming in scripts

Post by Lone_Wolf »

Currently Ship Storage Helper doesn't handle store & retrieving ships with shield cycler devices succesfully.
To solve this i am adding methods for storing & retrieving shieldcycler values in JSON format to Shield Cycler oxp.
These methods can be used by any oxp, and i want to verify they were created by SC and not changed after exporting them.

I was thinking of using MD5 checksumming for this, but javascript doesn't appear to have such functionality build in.
I found many implementations of MD5 for node.js, but sofar none for javascript itself.

Cabal Common Library does have a strGetCRC function, but i'm not sure if it's powerful enough to detect small changes.

How do other scripters deal with this ?
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Checksummming in scripts

Post by another_commander »

User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Checksummming in scripts

Post by Svengali »

Lone_Wolf wrote:
Cabal Common Library does have a strGetCRC function, but i'm not sure if it's powerful enough to detect small changes.
CCL also ships strEncrypt() and strDecrypt(), but it's not MD5.
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Checksummming in scripts

Post by Lone_Wolf »

strEncrypt() and strDecrypt() look useful, though not for checksumming.

another_commander, that link helped a lot.
I have some doubts about the MIT licensing the author uses, as it's based on code that uses BSD license.
I checked the site mentioned, and found http://pajhome.org.uk/crypt/md5/scripts.html .
Downloaded the jshash-2.2 zip file , and found the original code .

I'm looking into adapting the MD5 code to Oolite JS now.
Since this could be useful for other oxpers, i'll create a separate oxp for it which will keep the BSD license.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Checksummming in scripts

Post by Lone_Wolf »

I've read up a bit on compatible licenses, and it is allowed to publish BSD code under several other licenses including MIT & GPL as long as you keep the original copyright notice in the files.

Adapting the code to oolite is more work then i thought and i don't really want to include code with another license then CC in Oolite oxp.
Besides, for my purpose strEncrypt() and strDecrypt() from CCL can do the job.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
Post Reply