Skip to content

Comment on Ask HN: Examples of bad open-source code to learn what to avoid?parent

Comments

That advice is wrong too, a 32bit number would have been insufficient due to the birthday problem.

I don't think any reasonable person would expect zero collisions. The weakness of CRC32 for even distribution of hash values was well-known. (CRC32's goal was a fast "checksum" instead of strong cryptographic hash.)

The point was CDDB's non-invented-here home-grown hash algorithm was worse than CRC32. He didn't extract the maximum entropy from the discs' metadata of song times to minimize future collisions.

Exactly. Assuming 10 songs per CD, you should see your first collision after around 6500 CDs. If he did CRC64, it would be after 400 million CDs.

Why not use a SHA256 (or SHA512) then?

Because CDDB pre-dated the publication of SHA-* (2001) by at least 6 years.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.