Re: NSMapTable with C strings as keys
Re: NSMapTable with C strings as keys
- Subject: Re: NSMapTable with C strings as keys
- From: Jens Alfke <email@hidden>
- Date: Tue, 28 May 2013 14:10:55 -0700
On May 27, 2013, at 11:42 PM, Michael Crawford <email@hidden> wrote:
> For purposes of looking up strings in a hash table, a 32 bit CRC
> (Cyclic Redundancy Check) would be quick to calculate with few
> collisions. It also doesn't require multiprecision arithmetic.
CRC is primarily a checksum, not a hash function. It's good for verifying data integrity, e.g. in a network protocol or file format, but more expensive than you’d like for a hash table. There are much faster hash functions: Wikipedia has a good list[1].
—Jens
[1] http://en.wikipedia.org/wiki/List_of_hash_functions#Non-cryptographic_hash_functions
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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