You need to log in to create posts and topics.
Re: Checksums & SANE
77,940 Posts
#1 · December 17, 1997, 3:24 pm
Quote from Forum Archives on December 17, 1997, 3:24 pmPosted by: paul_bruneau <paul_bruneau@...>
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@cs.purdue.edu, mcgann@expert.cc.purdue.edu1. 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
Posted by: paul_bruneau <paul_bruneau@...>
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@cs.purdue.edu, mcgann@expert.cc.purdue.edu
>
> 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@cs.purdue.edu, mcgann@expert.cc.purdue.edu
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
Click for thumbs down.0Click for thumbs up.0