Unique ID auto-generated across Unconnected Servers
Posted: Wed Jul 16, 2008 8:26 pm
Information I have to work with:
- Location (must be included)
- first name
- last name
- phone
- address
- etc...
I need a way to generate a unique and short id out of the data above. What I'm doing now (as a stopgap) is the following.
Green Acres, John Doe, 555-1234
becomes
doe1234f42h890a
where f42h890a is the first 8 chars of base64_encode(location).
Details:
Problems, of course, include the fact that substr()ing the base64 location takes out data. The point is to make this short. People (generic people, not employees) will have to enter this as a passcode. The length it is now is about as long as I want it to get.
Also, there's a chance there will be two words that are similar enough that the first 8 digits will be the same (yes?). In addition, there's always a chance that the last name and last 4 digits of phone number could be the same. Example:
John Ward, 555-1234
Frank Ward, 123-234-1234
I'm running multiple servers completely off of any network that have to come up with this code. Don't ask. There are currently 2 such systems, but there will be 6 before next year and (with luck) a few dozen the next. There are currently three locations, but (with luck) there will end up being dozens to hundreds.
I also have to include the location field in the code somehow because when they enter the code, the app there needs to know the location. There's no way I can keep up a database of which 3 digit code means which location. The application has to figure out the location from the passcode only by using an algorithm.
In brief:
Using the above info, generate a completely unique id containing the location data. This code has to be as short as possible.
Does ANYONE have any ideas...?
Thanks.
- Location (must be included)
- first name
- last name
- phone
- address
- etc...
I need a way to generate a unique and short id out of the data above. What I'm doing now (as a stopgap) is the following.
Green Acres, John Doe, 555-1234
becomes
doe1234f42h890a
where f42h890a is the first 8 chars of base64_encode(location).
Details:
Problems, of course, include the fact that substr()ing the base64 location takes out data. The point is to make this short. People (generic people, not employees) will have to enter this as a passcode. The length it is now is about as long as I want it to get.
Also, there's a chance there will be two words that are similar enough that the first 8 digits will be the same (yes?). In addition, there's always a chance that the last name and last 4 digits of phone number could be the same. Example:
John Ward, 555-1234
Frank Ward, 123-234-1234
I'm running multiple servers completely off of any network that have to come up with this code. Don't ask. There are currently 2 such systems, but there will be 6 before next year and (with luck) a few dozen the next. There are currently three locations, but (with luck) there will end up being dozens to hundreds.
I also have to include the location field in the code somehow because when they enter the code, the app there needs to know the location. There's no way I can keep up a database of which 3 digit code means which location. The application has to figure out the location from the passcode only by using an algorithm.
In brief:
Using the above info, generate a completely unique id containing the location data. This code has to be as short as possible.
Does ANYONE have any ideas...?
Thanks.