Yep, that's what I'd do
This is the same problem as the Social Security Number validator - assume you have a list of all valid SSN's. Design a program/data structure to rapidly tell you if a given SSN is valid.
Bit vector turns out to be the only really fast solution that fits in memory.
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush