I’ve a list of server ip addresses that my application interacts to in order to collect live data. And the collected data is sent to slots in another system. These slots are identified by eight character length strings. And I would like to create this slots programmatically. I would like to create a method that will map an ip address of a server to an eight character string. eg. given 192.80.24.200 it will return SLOT0001 I assume a hash function will be a good solution but I’m not sure how it’s implemented.
The application is a C# Winforms .Net Framework 4.0. And the servers are windows based servers.
An IP address is 4 bytes long, which can be directly written as eight hexadecimal characters: