Re: Hash table
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 08/19/04
- Next message: Sara: "Re: Dropdown lists"
- Previous message: Daniel: "Retaining local file system access while impersonating to access a remote drive"
- In reply to: Marty: "Hash table"
- Next in thread: Marty: "Re: Hash table"
- Reply: Marty: "Re: Hash table"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Aug 2004 20:27:17 +0100
Marty <reply@to.forum> wrote:
> Does anyone has to face the problem of hashing a string of 12 characters
> AND avoid any collision?
>
> I'm looking for some algorithm who could return a good (small) hash
> value for any string of 12 characters.
For 12 characters to have a non-colliding hash, you'll need more than
24 bytes of hash. There are various ways of making it non-colliding -
an identity hash would do, to start with, if your one goal is to avoid
collisions. You obviously can't have a shorter hash and have no
collisions - there are too many strings and not enough possible hash
values! The point of a hash is usually to take a large amount of data
and hash it into a smaller value which is *unlikely* to collide with
that created by a different chunk of source data - but once you specify
that collisions mustn't occur at all, hashing just doesn't work as a
concept.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Sara: "Re: Dropdown lists"
- Previous message: Daniel: "Retaining local file system access while impersonating to access a remote drive"
- In reply to: Marty: "Hash table"
- Next in thread: Marty: "Re: Hash table"
- Reply: Marty: "Re: Hash table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|