• 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: Michael Hall <email@hidden>
  • Date: Tue, 28 May 2013 17:27:58 -0500

On May 28, 2013, at 4:10 PM, Jens Alfke wrote:

> 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].

http://en.wikipedia.org/wiki/Hash_function

Hashing with cryptographic hash functions [edit]
Some cryptographic hash functions, such as SHA-1, have even stronger uniformity guarantees than checksums or fingerprints, and thus can provide very good general-purpose hashing functions.
In ordinary applications, this advantage may be too small to offset their much higher cost.[5] However, this method can provide uniformly distributed hashes even when the keys are chosen by a malicious agent. This feature may help to protect services against denial of service attacks.

I thought I saw SHA-1 being used as a general purpose hash function somewhere sort of surprising recently but I'm not remembering exactly where. Maybe if the collision resistance or hash value uniformity out weigh the performance concerns?

Michael Hall

trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz

HalfPipe Java 6/7 shell app http://www195.pair.com/mik3hall/index.html#halfpipe

AppConverter convert Apple jvm to openjdk apps http://www195.pair.com/mik3hall/index.html#appconverter





_______________________________________________

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>)
 >Re: NSMapTable with C strings as keys (From: Jens Alfke <email@hidden>)

  • Prev by Date: Nib image caching
  • Next by Date: Re: NSMapTable with C strings as keys
  • Previous by thread: Re: NSMapTable with C strings as keys
  • Next by thread: Re: NSMapTable with C strings as keys
  • Index(es):
    • Date
    • Thread