@terdon For that purpose, you can also use a CRC. It depends on what the result of a collision is. Anyway for an n-bit checksum of any kind, collision probability between two random inputs is 2^(n/2). The birthday paradox gives probability of any collisions between m distinct inputs.
But unless the inputs are specially designed to cause a collision, you can treat MD5 as any other checksum with a 128-bit output, and SHA-256 as one with a 256-bit output. Note that for CRCs, you are guaranteed to detect any differences up to "burst size" that aren't a multiple of the CRC polynomial (which is good for detecting random errors).
at my last job we used to store redundant copies of data on nodes called "shrimp" and so if two shrimp were down in a region they would say "there is a high likelyhood of them storing copies of the same data because of the birthday paradox"
but there is an even higher likelyhood they didn't share the same data
in a group of 23 people there is a 50% chance that two of them share a birthday, but the chances that two of them chosen at random share a birthday is significantly lower
I guess if you combine the birthday paradox and murphy's law things could go sideways
Sure. That's the difference between a preimage and a collision.
If you have a person with a specific birthday and try to find someone else with the same birthday, it's much less likely than if you have multiple people with random birthdays.
@forest Unfortunately, it's not up to me. I mean, I am not implementing this, only using the existing compression tool which provides the md5sum checking itself. Sure, I could do it manually and just checksum the original file and store that and then compress, decompress and check manually but that would be considerably more complicated.
> While it’s certainly possible that someone, somewhere, at sometime uttered the phrase “If English was good enough for Jesus, it’s good enough for us” in earnest, this quote is most often used to paint politicians for being, perhaps, more ignorant of history and religion than they actually are.
@JeffSchaller If the emoji or symbol does not add anything important to the actual title, delete that symbol. If it does, keep it. Example of good use: unix.stackexchange.com/q/648352/116858
@JeffSchaller "I wanted to parse HTML, so I thought I'd use regular expressions. Now I have two </p>roblems</body></html>"