• 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: Fast hash of NSData?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fast hash of NSData?


  • Subject: Re: Fast hash of NSData?
  • From: Scott Ribe <email@hidden>
  • Date: Fri, 29 Nov 2013 19:26:11 -0700

On Nov 29, 2013, at 12:58 PM, Graham Cox <email@hidden> wrote:

> Another general question.
>
> Does anyone have a quick-and-dirty (but functional) way to hash NSData? I’m currently using SHA-1 but it’s quite slow. All I need is a way to determine whether one block of data is identical to another or not - but every bit counts. It doesn’t need to be of crypto-standard, but SHA-1 was convenient. Note that this can’t be the same as simply seeing whether one object is the same as another - I really do need to know if two different objects hold the same data bytes, and to derive a short, unique value that can be used as a key.
>
> I’ve previously written my own quick-and-dirty hash that was basically a weighted sum of the bytes, modulo some number, but it turned out to have collisions more often than I expected, so SHA-1 was then used to fix that problem. Now it’s causing quite a noticeable performance hit in some cases.

I recently (last week, no kidding) investigated this question, and went with murmur hash.
_______________________________________________

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: Fast hash of NSData?
      • From: Jens Alfke <email@hidden>
References: 
 >Fast hash of NSData? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Fast hash of NSData?
  • Next by Date: Re: Fast hash of NSData?
  • Previous by thread: Re: Fast hash of NSData?
  • Next by thread: Re: Fast hash of NSData?
  • Index(es):
    • Date
    • Thread