That's a bit small. (32 Bits)
How about using a 32 bit CRC check?
OR how about a MD5 hash which generates 16 bytes, then select 4 bytes from
the 16 byte array?
Myles.
-----Original Message-----
From: Donovan J. Edye [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 18, 2000 4:14 PM
To: Multiple recipients of list delphi
Subject: RE: [DUG]: [Q] Convert a given string to a magic number....
N,
- String can be any length
- Result "number" must "fit" into a longword (ie unsigned 32 bit number)
------------------------------------------------------------------------
--Donovan [[EMAIL PROTECTED]]
Donovan J. Edye [www.edye.wattle.id.au]
Namadgi Systems, Delphi Developer [www.namsys.com.au]
Voice: +61 2 6285-3460 Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': "...Uh Oh...."
------------------------------------------------------------------------
GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
------------------------------------------------------------------------
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Neven MacEwan
Sent: Wednesday, 18 October 2000 13:48
To: Multiple recipients of list delphi
Subject: Re: [DUG]: [Q] Convert a given string to a magic number....
D,
May be a bit obvoius but why hash? Any restrictions on max input
length/number size
Neven
----- Original Message -----
From: Donovan J. Edye <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Wednesday, 18 October 2000 15:43
Subject: [DUG]: [Q] Convert a given string to a magic number....
> G'Day,
>
> Another obscure one. Has anyone got any suggestins on how to turn an
> arbitrary string into a unique number?
>
> Eg 'ab' = 123
> 'ba' = 456
> 'abc' = 1234
>
> etc.
>
> My first thought was
>
> Original String --> Apply MD5 Hash --> StringOfFixed length -->
> MagicStringToNoEncoding = Desired Result
>
> ------------------------------------------------------------------------
> --Donovan [[EMAIL PROTECTED]]
> Donovan J. Edye [www.edye.wattle.id.au]
> Namadgi Systems, Delphi Developer [www.namsys.com.au]
> Voice: +61 2 6285-3460 Fax: +61 2 6285-3459
> TVisualBasic = Class(None);
> Heard just before the 'Big Bang': "...Uh Oh...."
> ------------------------------------------------------------------------
> GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
> replacement. Also includes freeware delphi windows explorer components.
> ------------------------------------------------------------------------
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"