On May 28, 2013, at 3:39 PM, Michael Hall <mik3h...@gmail.com> wrote:

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

Not exactly. It’s used in many version control systems as a highly reliable 
checksum to produce unique IDs for revisions, particularly IDs that can’t be 
forged. That’s not the same as a hash function, because in an application like 
this, a hash collision would cause serious problems like data loss. (That’s why 
you use something with 160 bits of output not 32!)

I’m sure these Git revision IDs do get used as hash keys at some point in some 
algorithms, but that’s not really their purpose (if you already have a SHA 
digest it’s cheaper to use it directly as a hash code than running its 160 bits 
through an in-memory hash algorithm, but it’s not necessary.)

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to