None of these combinations will pass the matrix

and thus there will never be a hash generated for them.

Never learned to read?

your code said otherwise. i read your code and you should did too.

i am done. bye.

you know, and can nothing.

Learn programming first, but likely you will fail.

How can one dare to show one's lack of everything in the public ?

procedure TForm1.Button1Click(Sender: TObject);

begin

Label1.Caption:= IntToStr(HashSmallInt(Edit1.Text));

Label2.Caption:= IntToStr(HashCardinal(Edit1.Text));

Label3.Caption:= IntToStr(HashQWord(Edit1.Text));

end;

function TForm1.HashSmallInt(const S: String): SmallInt;

var

P, P2: PChar;

begin

P:= PChar(S);

P2:= P + Length(S);

Result := 0;

while P < P2 do

begin

Result := Result shl 10 - Result shl 5 - Result + Ord(P^);

inc(P);

end;

end;

function TForm1.HashCardinal(const S: String): Cardinal;

var

P, P2: PChar;

begin

P:= PChar(S);

P2:= P + Length(S);

Result := 0;

while P < P2 do

begin

Result := Result shl 10 - Result shl 5 - Result + Ord(P^);

inc(P);

end;

end;

function TForm1.HashQWord(const S: String): QWord;

var

P, P2: PChar;

begin

P:= PChar(S);

P2:= P + Length(S);

Result := 0;

while P < P2 do

begin

Result := Result shl 10 - Result shl 5 - Result + Ord(P^);

inc(P);

end;

end;

BTW for QWord the hash could be made much faster by first simply moving up to 8 chars

into the QWord and starting bitwise from the ninth.

A set could take even 32 chars.

Would work best for case sensitive languages,

but insensitive would be no problem too.