Sign in to follow this  
Followers 0
gammasts

UDF: Sha1 Hashing

4 posts in this topic

#1 ·  Posted (edited)

Here is a dll and autoit functions for hashing strings and files using Sha-1.

Func _Sha1($string)
    $result = DllCall("au3sha1.dll", "str", "HashString", "str", $string) 
    return $result[0]
EndFunc

Func _Sha1File($file)
    $result = DllCall("au3sha1.dll", "str", "HashFile", "str", $file)
    if $result = 0 Then
        SetError(1)
    EndIf
    return $result[0]
EndFunc

Original code in C++ from Dominik Reichl at code project. Changed to a dll for usage of AutoIt by gammasts and ZeqMacaw.

Let me know if you want the dll source code.

Edit: Added the error for the file to it. It will return error 1 if the file is not found.

Have fun hashing.

au3sha1.dll

au3sha1.au3

Edited by gammasts

Share this post


Link to post
Share on other sites



Yes! I'd love to see the C source!

Where can I get it?

-mu

Share this post


Link to post
Share on other sites

Hey,

It's been a long time since I've browsed the forums. I'll try to find the source code for it, I probably still have it somewhere. If you can send me an IM on MSN or something, or just PM to remind me.

:)

Share this post


Link to post
Share on other sites

No worries, I found a C++ implementation of the SHA1 algorithm and slotted it (like it was that easy!) into my current favourite hashing dll (md5.dll from JSThePatriot) which works as an AutoIt plugin (no dllcall) ...

http://www.autoitscript.com/forum/index.ph...pic=21010&st=44

I'm still curious to see it (I'm just starting with C, so all working examples are useful) but if you don't find it, it's no biggie.

-mu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0