Ryan Michael McGann wrote: > > Happy Holidays to you all! > > This is really a two-part question: creating checksums and using SANE. > > I am creating an algorithm that checks for duplicate files based on the > following criteria- Creation date, mod. date, size in bytes (logical > resource and data forks), type and creator. Creating a checksum for this > would be ideal, but I am not sure how to go about doing it. I know how > to get the data, but I am not sure exactly how to create a checksum (or > for that matter, a real clear idea on what a checksum is). If I simply > add the data I get from GETCATINFO into a key (like key = size + > creator& + type& ...) that will not be a true checksum since different > things can add up to the same number, but I believe the odds are truly > too small for worrying about that (feel free to correct me if you > disagree). > > However, to add up several long ints I will need something bigger than a > four-byte variable. SANE supports a 64-bit variable, which I would like > to use. But what is the best way to implement SANE using double-long > integers, not floating point numbers? It seems as if the SANE.incl FNs > use the 80-bit floating pt. variable for operations and require you to > convert integers to floats to call the function and require you to > convert the floats back into dbl longs, which makes it much slower than > normal integer calculations. Is there a better way? > > TIA & have a safe holidays! > > Ryan McGann > mcrm@..., mcgann@... 1. I would tend to agree that it's doubtful that your checksum will repeat. 2. If you're afraid of that, however, why not just use a record that keeps all those items discreet rather than combining them? 3. I'm so afraid of SANE I can't begin to imagine using it instead of #2 above! PB