NSString inaccurate Hash
NSString inaccurate Hash
- Subject: NSString inaccurate Hash
- From: d2kagw <email@hidden>
- Date: Mon, 5 Feb 2007 08:13:01 +1100
Hi all,
I'm having an issue with some NSString Hashes...
Consider this Log entry:
NSLog ( @"%u - %u", [[NSString stringWithString:@"/Users/Azza/Music/
Various Artists - Top Hits/track.01.artist.02.03.mp4"] hash],
[[NSString stringWithString:@"/Users/Azza/Music/Various Artists - Top
Hits/track.02.artist.02.03.mp4"] hash] );
it should log the hash of two strings: "/Users/Azza/Music/Various
Artists - Top Hits/track.01.artist.02.03.mp4" and "/Users/Azza/Music/
Various Artists - Top Hits/track.02.artist.02.03.mp4"
the difference between them being "track.01" vs. "track.02"
If I execute this code I get the result "2040446062 - 2040446062"
meaning the two hashes are identical!?
I knew NSString hash wasn't exactly unique, but I would have expected
a little more than this :P
are there any other good hash methods/classes avaliable that I can
use to generate hashes ( my app creates cache files of accessed data
and the hash was meant to be the unique filename for the cache )
cheers!!!
- Az
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden