views:

208

answers:

1

I need the shortest possible Ids so I figure base-36 would work wonderful for this. The thought is I'll just use an auto-incrementing Id field as the primary key and then create a base-36 userid. Unfortunately I'll inevitably run into a lot of vulgar word combinations. I'm having a hard time wrapping my head around the best approach to solve this because the suspect word could be in any combination of strings.

Any thoughts?

Thanks

+6  A: 

You could omit vowels from your selection of digits (either using base 31 or adding some more characters to bring it back up to 32 or 36 or whatever).

If your system can handle being case sensitive, then you can use both upper and lower case letters to extend your range of digits. You indicated that length is important, so this might be a useful approach.

Greg Hewgill
Yea, I like that a lot better than using a wildcard replace. Thanks!
Chance
upper/lower without vowels is 62, chuck in another two and you've got your own profanity free implementation of base64... not nearly as much fun, but I suppose you're right in that it might save some explanations down the track...
Matthew Scharley