• 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: Greg Parker <email@hidden>
  • Date: Tue, 28 May 2013 15:55:48 -0700

On May 28, 2013, at 3:39 PM, Michael Hall <email@hidden> wrote:
> On May 28, 2013, at 5:27 PM, Michael Hall wrote:
>> 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.
>
> Ah, sorry to reply to my own but maybe this was it…
>
> https://news.ycombinator.com/item?id=4036878
> SHA-1is still used in applications such as git as a general purpose hash function.
>
> Not this particular article where I saw it but I recently signed up on git and think I may of seen it's use then.

For this sort of use I expect SHA-1 is chosen in part because it computes a bigger value than a typical hash-table hash. (160 bits for SHA-1 and 256+ for SHA-2, versus 32 or 64 for a typical hash table.)

git in particular wants an ID that is as globally unique as possible so 64 bits is not enough, is computing a small number of hashes so the extra per-hash setup time for a cryptographic hash is less important, and is probably I/O bound anyway so the extra CPU time of a cryptographic hash is less important.


--
Greg Parker     email@hidden     Runtime Wrangler



_______________________________________________

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

  • Prev by Date: Re: NSMapTable with C strings as keys
  • Next by Date: Re: 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