AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

checksum

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
bahri



Joined: 24 Jun 2004
Posts: 104
Location: Malta

PostPosted: Tue Mar 01, 2005 11:41 am    Post subject: checksum Reply with quote

Hi all!
How about a variable that captures the checksum of a file, may be md5.
This is great for comparing files for changes in a definitive way.
Can be used as a file backup check etc.
OK can be done with dates and times but an md5 sum is much more definative.
There's command-line utils that can do this but I like to stay within ahk as much as possible.
Thanks
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Mar 01, 2005 12:06 pm    Post subject: Reply with quote

Why sould I be interested to download/keep unnecessary code/features which attracts a minority of people, while it needs only a single line of code within my script like ...

Code:
Run, dsmd5 inputfile


... to accomplish that task ?

FYI:
dscrc = 5 Kb
dsmd5 = 6Kb
dsshc = 7Kb
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue Mar 01, 2005 12:26 pm    Post subject: Reply with quote

Although a checksum command might be added someday, for now I agree that it's a little too far outside the central mission of AutoHotkey. I also feel the same way about a built-in encrypt command.

However, if the md5 checksum or some good CRC method is a very short block of code, I would reconsider. Small easy things, such as SoundBeep, get a higher priority.
Back to top
View user's profile Send private message Send e-mail
bahri



Joined: 24 Jun 2004
Posts: 104
Location: Malta

PostPosted: Tue Mar 01, 2005 12:30 pm    Post subject: Reply with quote

If you're not interested, just don't use the feature.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue Mar 01, 2005 12:32 pm    Post subject: Reply with quote

I should clarify that code size is a consideration because it affects the size of all compiled scripts, as well as the amount of resources that every script uses. So the decision on whether to add a new feature is based on:

1) What percentage of users would use it.
2) How big a benefit is it.
3) How large is the code and how difficult is it to integrate.

In this case, MD5 appears to score low in all three. However, I'm always open to contrary opinons, or even a poll to vote on which features should be included and which things not.
Back to top
View user's profile Send private message Send e-mail
bahri



Joined: 24 Jun 2004
Posts: 104
Location: Malta

PostPosted: Tue Mar 01, 2005 12:53 pm    Post subject: Reply with quote

Chris, You're right and I appreciate all the work you put in AHK.
Thanks for a great program.
Back to top
View user's profile Send private message
niwi



Joined: 27 Feb 2005
Posts: 128
Location: Heidelberg, Germany

PostPosted: Wed Mar 02, 2005 5:37 pm    Post subject: Reply with quote

Hi,

maybe someone knows a good and small checksum algorithm and may write an AHK script so it may be possible to build a function library. If someone needs a checksum he / she may just include the code of this library.

Regards, NiWi.
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Thu Mar 03, 2005 8:25 am    Post subject: Reply with quote

Just in case someone doesn't know anything about it ... Smile
Quote:
Check this out ---> [Algorithms]

Taken from [here]

Cool
Back to top
niwi



Joined: 27 Feb 2005
Posts: 128
Location: Heidelberg, Germany

PostPosted: Thu Mar 03, 2005 5:53 pm    Post subject: Reply with quote

Hi BoBo,

ok, MD5 is neither a checksum nor an encryption. But it could be used as an checksum algorythm because it generates a 128 bit long term depending on the source and detecting changes like capital letters or different positions of a character in the input string.

But if Bahri have a need for this, it should not be a problem to create an AHK script and use the #include command to load this.

BTW: AHK is not able to use custom functions with parameters yet. Is there a styleguide for building variables and use gosub? I think about setting the vars first, which may start with defined characters such as double underscores:
#include functionlib.ahk
__myfirstparam = Hello
__mysecondparam = world.
gosub, f_testfunction
returnvlaue = __myreturn

It is not really pretty, but it should work. Smile

Regards, NiWi.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Thu Mar 03, 2005 6:14 pm    Post subject: Reply with quote

niwi wrote:
Is there a styleguide for building variables and use gosub?
There is a short one on the Variables page:
http://www.autohotkey.com/docs/Variables.htm (as "Naming Variables to Improve Maintainability")

As as you pointed out, the ability to pass parameters and receive return values from subroutines is planned for the near future.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group