• 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: Kyle Sluder <email@hidden>
  • Date: Fri, 29 Nov 2013 15:49:52 -0800

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

>
>
>> On 29 Nov 2013, at 10:49 pm, Kyle Sluder <email@hidden> wrote:
>>
>> In this scheme, if there is a hash collision, you lose user data. That should be a non-starter. You *must* do a full bytewise comparison in case of collision.
>
> I wouldn’t say a non-starter. In practice, the odds of this are exceedingly small *provided* the hash function is good.

Much as a civil engineer would find it unconscionable to knowingly choose a bridge design that could not be guaranteed to support the design load, so too should a software engineer instinctively avoid any solution that they know has even a remote possibility of losing data under normal operation.

Plus, since you're already keying by size, you can afford to use a faster but higher-collision hashing algorithm.

--Kyle Sluder
_______________________________________________

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


References: 
 >Fast hash of NSData? (From: Graham Cox <email@hidden>)
 >Re: Fast hash of NSData? (From: Kyle Sluder <email@hidden>)
 >Re: Fast hash of NSData? (From: Graham Cox <email@hidden>)
 >Re: Fast hash of NSData? (From: Kyle Sluder <email@hidden>)
 >Re: 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