in reply to Re: Re: Automatically creating incremental file names
in thread Automatically creating incremental file names
. . . wouldn't that mean that the existing file already contains exactly the same data as the current run?
For SHA1, there is a 1 in 2**160 chance that it isn't the same data, but produces the same hash. Actually, because of the Birthday Paradox (external link), it's more like 1 in 2**80.
This chance is so tiny that you could ignore it and probably get away with it, even if your program was running until the sun burned out. Even so, I like to be certain if at all possible, which is why I had that while loop in my post above.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|