package
module
Version:
v0.0.0-...-81a1a38
Opens a new window with list of versions in this module.
Published: Feb 24, 2017
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 11
Opens a new window with list of known importers.
README
¶
Luhn Algorithm
Generating check number & validating Luhn numbers in GO
Usage
import "github.com/theplant/luhn"
func main() {
// Checking if a string is a valid luhn
luhn.Valid(1111) //= false
luhn.Valid(79927398713) //= true
luhn.CalculateLuhn(7992739871) //= 3
}
Documentation
¶
func CalculateLuhn(number int) int
CalculateLuhn return the check number
Valid check number is valid or not based on Luhn algorithm
Source Files
¶
Click to show internal directories.
Click to hide internal directories.