i'm looking for a way to get the hash of a file i'm not picky how as it only so that i can see when they have changed. so any ideas how i can get the hash of a file?
thanks in advaced
chris
A utility or through code?
tjs, a user of our forums, wrote a utility:
http://www.download.com/MD5-Checker/3000-2092_4-10410639.html
Paul.
i would like to do it through code as i need t use it in a larger program
This may be useful.
You can find it in the codeArchive created by Joske
$INCLUDE "md5.inc"
DECLARE IMPORT, GetCommandLine ALIAS GetCommandLineA (), POINTER
MD5_CTX ctx
STRING hex, user
FLOAT t1, t2
POINTER pcmdline
INT pos
STRING szfile
pcmdline = GetCommandLine()
pos = INSTR(*<STRING>pcmdline, " ")
IF pos
szfile = LTRIM$(MID$(*<STRING>pcmdline, pos+1))
IF LEN(szfile) = 0
PRINT "can't make out the file you want to test on"
END
ENDIF
ELSE
PRINT "can't make out the file you want to test on"
END
ENDIF
t1 = MILLISECS()
md5_init(ctx)
IF md5_readFile(ctx, szfile)
hex = md5_digest(ctx)
ELSE
PRINT "File " + szfile + " not found"
ENDIF
t2 = MILLISECS()
PRINT (t2-t1)/1000.0
PRINT hex
INPUT "any key...", user
and here is the include file to use it with