creating a SHA hash - assess text file identity

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Access 2000 VBA VB6
I work with text files a lot and I want to be able to determine with a fair
bit of certainty whether the file I'm currently looking at is identical to
the file I was looking at, at some time in the past. For example, say I'm
looking at a file today called 20050506.txt. Are the file's contents
identical to when I last looked at the file?
What I was thinking is that when my app accesses a file, it could create
some sort of a hash value and store it in a table against that filename. If I
ever need to look at that file again, and I want to be certain that it has
not been altered, I would create a new hash value, compare it to the stored
value, and if they were the same I would know the contents were the same. Can
anybody point me to VB6 code that could do something like this?
 
Thanks, yes. Got it (the freevbcode.com thing) working. Takes about 30 secs
to hash a 1.5mb file, which is OK for what I want.
 
FWIW there are hashing algorithms in the Windows API, provided by
advapi32.dll. I've never used them and don't know what they're capable
of, but they seem to include at least one flavour of SHA.
 
Back
Top