Most credit card number can be validated using the Luhn algorithm, which is more or a less a glorified Modulo 10 formula!
Added the Sorocred credit card flag, valid for Brazil.