• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSMapTable with C strings as keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSMapTable with C strings as keys
      • From: Michael Hall <email@hidden>
References: 
 >NSMapTable with C strings as keys (From: Oleg Krupnov <email@hidden>)
 >Re: NSMapTable with C strings as keys (From: Jens Alfke <email@hidden>)
 >Re: NSMapTable with C strings as keys (From: Oleg Krupnov <email@hidden>)
 >Re: NSMapTable with C strings as keys (From: Michael Crawford <email@hidden>)

  • Prev by Date: Re: What, exactly constitutes a mutable action on an instance?
  • Next by Date: NSMatrix used as menu item's view appears wrong
  • Previous by thread: Re: NSMapTable with C strings as keys
  • Next by thread: Re: NSMapTable with C strings as keys
  • Index(es):
    • Date
    • Thread