Topics Map > University of Chicago > IT Services > Accounts, Identity, & Security > Identity Management
ChicagoID Generation Specification
This article describes details of how a ChicagoID is generated, assigned, and checked to ensure uniqueness.
Nine character string CD1D2D3D4D5D6D7A, where C is a check digit [0-9], described below, D1-D7 are digits [0-9], and A is an uppercase alpha [A-Z].
With 260,000,000 values, the namespace is pretty roomy for us. We'll reserve a large portion of this namespace for future use. All ChicagoIDs assigned by the MCDB at this time should have '00' <= D1D2 <= '19'. That leaves 52,000,000 identifiers, which ought to tide us by for a bit.
There's a requirement for having a check digit, and it makes no sense to have one if ChicagoIDs are sequentially assigned. Hence, ChicagoIDs will be randomly chosen from the allocated namespace using a uniform distribution. It is sufficient to make 2 uniform random selections, one between 0 and 1,999,999 and a second between 65 and 90 (ascii values of A-Z) to select the letter to arrive at a nominated ChicagoID that is then checked against all previously issued ChicagoIDs in the MCDB.
Check digit algorithm
It seems that, for strings of decimal digits, most everyone uses the Luhn algorithm. It's a good balance between catching typical typing errors and simplicity. We'll need to fold the ChicagoID's trailing letter in, and, for ease of writing validation routines and with the letter being at the end, the check digit will be at the front. So here's the modified Luhn validation algorithm:
- Transform the string D1D2D3D4D5D6D7A1A2, where A1A2 is the decimal string representation of the ascii value of A, into an array of integers.
- Assuming arrays are indexed starting from 0, for each odd element of the array, replace its value with the sum of the digits of the number which is twice its original value.
- Form the sum of the elements of the resulting array and add the check digit C. The result should be divisible by 10.
So, create the check digit so that the result in step 4 is divisible by 10. Example:
|Make array||-||1||2||3||4||5||6||7||7||0||70 = ascii('F')|
|Double odd elements||-||4||8||12||14|
|Sum of digits + check digit||4||1||4||3||8||5||3||7||5||0||= 40|