Serial Number Generation / Validation with optional 'flags'

Hi all,
I've been working on a method of generating & validating serial numbers for different applications that I'm developing, and am having issues working out exactly where to go from here.
I can generate a serial based on information provided in a few fields (names, version numbers, that kind of thing) and validate that easily enough, but what I'd really like to be able to do is select different 'features' for any given product and be able to see what features are 'enabled' by a given serial number.

From my understanding, it's possible to do something along these lines using something to do with different powers of 2, i.e. if option A = 1, B = 2, C = 4, D = 8 and E = 16, and we were to validate a value of 19, we would be able to tell that option A, B, and E were selected.

Is there an easy way for me to begin working on this that someone has previously come across, or could someone point me to any documentation?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You might have better luck posting this question under the language you're using.  

In C#.NET an enumeration can use a "Flags" attribute that allows what you mention.  The documentation for it should help you get a sense for what you need to do.  You can read about it here:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vixtroAuthor Commented:
Thanks for that. It looks like that's the kind of thing i'm after, going to require a bit of digging around to implement it I think!
I'm using VB.NET at the moment, .NET 3.5.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.