Saturday, January 24, 2009


Assigning user identifiers

Assignment of user identifiers (or “usernames”, or whatever you call them; hereinafter “user IDs”) can be a bit tricky. Nowadays, we usually pick our own (and it becomes part of the email address), though sometimes there are limitations to what one is allowed to choose (Gmail, for instance, won’t allow something “too simple”, like “fred”). In the old days, though, they were often assigned to users automatically.

Automatic assignment was a particular problem for universities: how can we set up a mechanism whereby a raft of new user IDs — perhaps thousands — are assigned at the start of each school term? Some students will be back, and we might like to keep their old user IDs for them. Others will have gone and we can re-claim their IDs, but is it wise to use the same ID again so soon? Still others will be new, and will need new IDs that don’t conflict with existing ones.

When I was in school, my university solved this problem by using account numbers. Students didn’t keep the same account number from one semester to the next, nor even from one class to another, and no one could, without a list, match a particular account to a particular student. On the other hand, it allowed accounting to be separated among courses, and gave professors some control.

But many schools wanted their students to have some sort of “sensible” user ID; something like “barryleiba” is better than something like “30093486,12” in this case. I was involved, back then, in a conversation about this in relation to a system that limited user IDs to seven characters. One of the participants in the conversation talked of his university’s mechanism:

Their idea was to find a method that generally gave them a unique user ID, and from which one could usually figure out someone’s ID if one knew the student’s name. Collisions would be handled manually. The scheme they came up with was to take the first three letters of the student’s last name, followed by the first three letters of the first name, followed by the middle initial. Students with no middle initial would arbitrarily get “X” for the seventh letter; similarly, first or last names of fewer than three letters would be padded with “X”. So my user name would have been “LEIBARX” under that system (I have no middle name), and a student named Li Cho Hu would be “HUXLIXC”.

The system worked well for some time, he said. Until they got a student named Shirley T. Eaton.

The moral of the story is that no matter what system you have, you really need to have an easy way to bypass it, without a lot of red tape and “I can’t do that.”

1 comment:

thom said...

I had the same problem personally several times when practically every company was using first initial + lastname. The worst was when I worked at a company that used first initial + only the first four letters of lastname (and then padded it with three digits).

My last name is Watson.