@tapbot_paul Probably because -hashValue does not guarantee uniqueness. Without this, putting NSData in a collection would take ages.
-
-
-
@SlaunchaMan ^= _length would hardly add any time to it. -
@tapbot_paul True. I wonder if -length has any weird performance penalties?
-
-
-
@tapbot_paul same for NSString. First 80 characters or so. -
@bdkjones NSString does take length into account though. -
@tapbot_paul Collisions still possible. Strings of same >80 length with identical first 80 characters. Edge case, but possible. -
@bdkjones@tapbot_paul I think it’s first, last and middle 32 characters for NSString.
-
-
-
@tapbot_paul prepend the length to the data, voila! Unique hashes. hashtag-programming! -
@DigDoug@tapbot_paul nope. Possible for two datas of same >80 length to have identical first 80 bytes. Not safe in all cases.
-
-
@tapbot_paul the hash of nsarray is just its length. -
@tapbot_paul Maybe length isn’t always O(1) to calculate? Does NSData have a generator API? -
@tapbot_paul that seems rather counter to what one might want to do with NSData.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Paul Haddad
Jeff Kelley
Bryan Jones
Karsten Bruns
DigDoug
Christian Kienle
Frederic Barthelemy
Wayne Dixon