[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: Algorithm



#probably OT

if you have 255 char string, and wish that each one of those strings have a
unique identifier map to them then taht would equal :
256 // because there can be 256 1 char strings , incl NULL
+ 256 * 256 // because the two characters are independent
+ 256 * 256 * 256 
+...
+ 256 * 256 * .. 255 times

Wwith appropriate approximations, that would be "somewhere near" my last
estimate.

If the MAXINT of the machine is less than taht, no way you can have
theoretically unique ID.
Of course, in real life you can have it pretty well.. but hashing will _not_
guarantee that.

HTH,regards,
Shourya



#-----Original Message-----
#From: srinivasan ranganathan [mailto:srini_linux@xxxxxxxxxxx]
#Sent: Friday, October 27, 2000 7:01 PM
#To: linux-india-programmers@xxxxxxxxxxxxxxxxxxxxx
#Subject: RE: [LIP] Algorithm
#
#
#I don't really understand what u just said. Please explain....
#
#Regards
#Sridhar Ranganathan
#
#
#>From: "Sarcar, Shourya (MED)" <Shourya.Sarcar@xxxxxxxxxxxx>
#>Reply-To: linux-india-programmers@xxxxxxxxxxxxxxxxxxxxx
#>To: linux-india-programmers@xxxxxxxxxxxxxxxxxxxxx
#>Subject: RE: [LIP] Algorithm
#>Date: Fri, 27 Oct 2000 18:57:12 +0530
#>
#>i figure that could be tough, even with gperf
#>even raw-hashing could create duplicates, although I have 
#heard taht gperf
#>creates a good hashing function.never used it as yet.
#>
#>i assume you are talking about an unsigned integer ID.
#>Your ID space for the string would be
#>pow(26+26+10+allowed_special_characters,255) which I think is 
#mucho larger
#>(is it ?) that the MAXINT of a machine with 64 bit ints (long long in
#>Linux).
#>
#>
#>
#>#-----Original Message-----
#>#From: Balakrishnan Kalidas [mailto:kalidasbala@xxxxxxxxx]
#>#Sent: Friday, October 27, 2000 6:27 PM
#>#To: linux-india-programmers@xxxxxxxxxxxxxxxxxxxxx
#>#Subject: [LIP] Algorithm
#>#
#>#
#>#Hi,
#># Does anybody know how to generate an unique ID for a
#>#given 255 char(max) string. I need it urgently for my
#>#project.
#>#
#>#Thanx in advance.
#>#
#>#Kalidas Balakrishnan
#>#
#>#
#>#__________________________________________________
#>#Do You Yahoo!?
#>#Yahoo! Messenger - Talk while you surf!  It's FREE.
#>#http://im.yahoo.com/
#>#
#>#---------------------------------------------
#>#The mailing list archives are available at
#>#http://lists.linux-india.org/cgi-bin/wilma/LIP
#>#
#>
#>---------------------------------------------
#>The mailing list archives are available at
#>http://lists.linux-india.org/cgi-bin/wilma/LIP
#
#_______________________________________________________________
#__________
#Get Your Private, Free E-mail from MSN Hotmail at 
http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


---------------------------------------------
The mailing list archives are available at
http://lists.linux-india.org/cgi-bin/wilma/LIP