Jump to content
Sign in to follow this  
JSThePatriot

MD5 Hash Plug-in SHA-1

Recommended Posts

I am using the MD5 DLL to write a program that finds duplicate files. However, in several instances the function returns 0 for the hash, although the file sent actually exists. The majority work fine, but because of this files with "0" hashes are found similar while in reality there are not. Some file names had french characters in their name. I wonder if there is a way to debug this. I am also not sure what the "true" and "1" mean in this call from my program

MD5Hash($Files[$i], 1, True)

Example file name that returns 0 for hash

My Music\divers artistes\20 Ans Nostalgie Française Disc 1\03 L'été indien.mp3

Thanks

Share this post


Link to post
Share on other sites

where is MD5Hash function?

After I run the md5 sample I get :

How can I use this to get md5 of a file? I want to make a check sum of my file.

: ==> Unknown function name.:
MsgBox(0, "Test MD5Hash.DLL", "String 'Test String':" & @TAB & MD5Hash("Test String",
MsgBox(0, "Test MD5Hash.DLL", "String 'Test String':" & @TAB & ^ ERROR

Edit: Ok I dont know what is the sample problem, it wont work, but this sample works fine: the speed is kind of slow tho:( it took 30 sec to checksum 1500 files total size 500 MB

But this seems to be the only UDF that actually works so I say Thank you!

$begin = TimerInit()

#compiler_plugin_funcs = MD5Hash

Dim $FileMD5
$MD5Plugin  = PluginOpen(@ScriptDir & "\MD5Hash.dll")   

;~ ------------------------------------------------------
    $path   = 'D:\temp\F1\Sumacher\'
    $search = FileFindFirstFile($path & "*.*")  

    ; Check if the search was successful
    If $search = -1 Then
        MsgBox(0, "Error", "No files/directories matched the search pattern")
        Exit
    EndIf
    While 1
        $file = FileFindNextFile($search) 
        If @error Then ExitLoop

        
        $FileMD5    = MD5Hash($path & $file,1,True)

        $dif = TimerDiff($begin)        
        ConsoleWrite($file & ' ' & $FileMD5 & ' ' & $dif/1000 & @CRLF)  

    WEnd

;~ ------------------------------------------------------

FileClose($search)
PluginClose($MD5Plugin)

$dif = TimerDiff($begin)

ConsoleWrite($dif/1000 & @CRLF)
Edited by goldenix

Share this post


Link to post
Share on other sites

Nuttapong,

In future, please do not necro-post just to say thanks. Asking a valid question about the code is fine, but merely padding the thread is not. ;)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

wakillon,

I stand by my original post - necroing a 3 1/2-year old thread just to say thanks is not something to be encouraged. And if the poster is scared away by that very mild comment complete with "smiley", I have grave fears for their survival in the real world let alone the internet. ;)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

I am having the same issue as Goldenix. What am I doing wrong?

: ==> Unknown function name.:

MsgBox(0, "Test MD5Hash.DLL", "String 'Test String':" & @TAB & MD5Hash("Test String",

MsgBox(0, "Test MD5Hash.DLL", "String 'Test String':" & @TAB & ^ ERROR

Edited by jtrout

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  

×
×
  • Create New...