Re: Hash table

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 08/19/04


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


Relevant Pages

  • Re: Base36
    ... static string tokens = ... But - I don't think you want all those silly characters in the product key. ... I should be able to recalc the hash at the client ... > conversion to long so I can pass each long to the BaseXX converter to get ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to omit blank spaces in the text?
    ... Private Sub Command1_Click ... Dim ssql As String, ssql2 As String, ssql3 As String, trimname As String ... character set from &H21 to &H7E provides for ASCI alpha numeric characters ... >> When the password is first created you calculate the hash and store>> that, ...
    (microsoft.public.vb.general.discussion)
  • Reducing the chance of collisions in known encryption systems
    ... is needed is any password that will result in the captured hash. ... A very long string of random characters ... Firstly a rule is decided upon so that we dont make this terminally ...
    (sci.crypt)
  • Re: who wants a crack at this
    ... (and IIRC my Javascript) all ... non-alphabetic characters are effectively converted to 'A'. ... word "hash". ... are interested only in the probability of accidental collisions, ...
    (sci.crypt)
  • Re: 12 to 8 bit Hashes - application to chess
    ... Mike Amling wrote: ... As fast as that might be for encoding, how are you going to decode if there are collisions? ... And the "hash" would just be a 4K table lookup. ... The remaining bits of the output are from a 6x64x64 array MOVESwhose elements have a bit string and the length of that bit string. ...
    (sci.crypt)