https://en.wikipedia.org/wiki/Collision_(computer_science)

The uniqueness of a string does not guarantee the uniqueness of the hash. It's hard to force one, the accidental likelihood is low, and the failure behavior in this code is safe, so like I said, it isn't likely to cause problems. Using a hash fells forced and unnecessary, but this code is fine either way.