I’m using hash on an NSString to get an integer to uniquely represent a URL and then store it in Core Data to unique the object.
Is that enough to make sure it’ll be unique? The URL string is usually 50 to 80 chars.
If it’s not I’ll gladly accept any suggestion to make it better!
No, the hash is not enough to unique an URL. The purpose of hash is to distribute objects like for example, computing the hash table index.
With hash code you can do a fast comparison and if two objects have two different hashes they’re different, if they have the same hash you gotta use compare.