One common method to checking serial numbers is to use a hash algorithm. A hash algorithm is a one-way function, this means you calculate a sort of checksum, but it is not possible to calculate the serialnumber if the hash value is known.

I am sure you will the sourcecode to a hash algorithm can be found at the Internet.

I am sure you will the sourcecode to a hash algorithm can be found at the Internet.