Implement a validation algorithm for credit card.