Thanks, @Alexey Maslov! What is the preferred algorithm to use hashes in this case?

And what about collisions? Should I care about that too?