goluhn

Validates credit card numbers using Luhn's algorithm and regular expressions.
Installation
go get -u github.com/abadojack/goluhn
Usage
import "github.com/abadojack/goluhn"
Validate credit/debit card number
goluhn.IsValid("4024007146787212") //returns true
Validate credit/debit card number and return type
goluhn.CardType("4024007146787212") //returns visa
Credit cards supported
- (Visa) Electron
- Amex
- Dankort
- Diners
- Discover
- JCB
- Interpayment
- Maestro
- Unionpay
- Visa