Oolite Bulletins

For information and discussion about Oolite.
It is currently Thu Nov 15, 2018 2:39 pm

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Checksummming in scripts
PostPosted: Mon Jun 08, 2015 2:00 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 08, 2007 10:59 pm
Posts: 545
Location: Netherlands
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

I am subscribed to the threads for my oxps, if you need my attention just post in them or send a pm.


Top
   
PostPosted: Mon Jun 08, 2015 2:07 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5283
Is this of any help?
https://github.com/blueimp/JavaScript-M ... /js/md5.js


Top
   
PostPosted: Tue Jun 09, 2015 9:52 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Oct 20, 2007 2:52 pm
Posts: 2340
Quote:
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.


Top
   
PostPosted: Tue Jun 09, 2015 12:58 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 08, 2007 10:59 pm
Posts: 545
Location: Netherlands
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

I am subscribed to the threads for my oxps, if you need my attention just post in them or send a pm.


Top
   
PostPosted: Wed Jun 10, 2015 3:16 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 08, 2007 10:59 pm
Posts: 545
Location: Netherlands
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

I am subscribed to the threads for my oxps, if you need my attention just post in them or send a pm.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited