を使用hash
してNSString
、URLを一意に表す整数を取得し、それをCoreDataに格納してオブジェクトを一意にします。
それがユニークになることを確認するのに十分ですか?URL文字列は通常50〜80文字です。
そうでない場合は、それを改善するための提案を喜んで受け入れます!
を使用hash
してNSString
、URLを一意に表す整数を取得し、それをCoreDataに格納してオブジェクトを一意にします。
それがユニークになることを確認するのに十分ですか?URL文字列は通常50〜80文字です。
そうでない場合は、それを改善するための提案を喜んで受け入れます!
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.