|
-
February 10th, 2015, 01:38 AM
#1
How to generate unique number for each address?
I have couple of ip address like this -
19.22.145.103
20.52.175.104
19.92.192.102
11.20.175.108
I want to create a unique number which should be short data type for each of the above IP Address. I was doing it this way -
Sum of each octet 19 + 22 + 145 + 103 = 289 as the unique number.
But by this we might have same number for some IP Addresses since we are just summing the octet.
19.22.145.103 = 289
20.52.175.104 = 351
19.22.147.101 = 289
11.20.175.108 = 314
As you can see above, `289` is coming for two IP Address with my algorithm for summing the octets which is not what I want. I need a unique number which is short data type for each ip address.
Is there any better way to do this with some other formula? I thought my algorithm will guarantee uniqueness.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|