What is a good, easy-to-implement hash algorithm for avoiding hash collisions?

I am working on a proxy dll for DirectX 9, and eventually DirectX 11, which dumps textures uploaded via the cpu to files on the disk. Crucial to some of the features I wish to implement is the ability to identify which files correspond to which textures after relaunching the DirectX-powered program.

I didn't want to use memory addresses to identify the files due to the "random" nature of memory addresses between subsequent program launches.

I decided to identify the textures by hashing the raw data, essentially identifying them by their contents.

As such, my priority is not algorithm security, but rather the uniqueness of the hashes. I also need to be able to implement such an algorithm into my own code, or use a library with a lax license.

New contributor
Adolif4 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
• Since you say security issn't an issue, I assume you're asking about avoiding only accidental collisions, not intentional collisions? In that case, have you considered using a CRC with a proper polynomial (if in doubt though, CRC32c is often a good choice). However any hash function or checksum will be too slow if you need to run it at an extreme rate. Anyway, if it's not about security, then it's off-topic on this specific SE. – forest Jul 12 at 6:02
• Oh, I apologize. I wasn't aware of that. My specialty is game programming, so I had to do quite a bit of Wikipedia reading just to write the question. Two different worlds. – Adolif4 Jul 12 at 6:10
• Well, Game Development might help, especially if this is an XY problem. What's important though is knowing how low of a collision probability is required. Is $2^{-32}$ fine? Does it need to be $2^{-128}$? – forest Jul 12 at 6:18
• Well, even though it was in a comment and not a "proper" answer, you already gave me a lead. Given that my biggest priority is minimizing the possibility of accidental duplicate hashes, I've come to believe that CRC64 might be the best option. Most of the sites where it is discussed seem to dislike it due to its supposed lack of standardization. That is, however, of no concern to me. I'm just looking to identify blobs of data based on their contents. – Adolif4 Jul 12 at 6:46
• Please note that CRC64 is not automatically better than CRC32. There are many situations where the latter is better at detecting collisions than the former. This is a result of a CRC's so-called "burst detection". – forest Jul 12 at 6:54