Results 1 to 4 of 4

Thread: Self-referential checksum

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662

    Self-referential checksum

    I have a need for two or more files to contain checksums (say, MD5) of each of the other files, such that if any one file changes, the other files will contain the old (thus incorrect) checksum.

    How might I do this?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Self-referential checksum

    No development platform specified so unsure where to move this.

    Moved from Chit Chat

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Self-referential checksum

    You usually don't use include checksum portion of a file in the checksum. i'd suggest that you do the same thing - reserve as many bytes as you need for the checksum, then checksum the rest of the file.

    If you're talking about each file just being the checksum of the other, you have what's known in hardware as a race condition, and in cartography as "you can't get there from here". In informal circles, you're said to be SOL.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662

    Re: Self-referential checksum

    hmm... thought so... ok. now onto plan b, as stated above by somebody else...

    What I really wanted to do was be able to detect if somebody was trying to change the checksum itself in one of the files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width