Documentation
¶
Overview ¶
Package luhn implements the Luhn algorithm, which is commonly used to add checksums to credit cards and identity codes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDigit ¶
CheckDigit returns the digit needed to make its input valid.
func CheckDigitInt ¶
CheckDigitInt returns the digit needed to make its input valid.
func IsValid ¶
IsValid returns true if the input is valid according to the Luhn algorithm.
Note that IsValid assumes input characters are all digits. Output is undefined for unexpected characters.
func IsValidInt ¶
IsValidInt returns true if the input is valid according to the Luhn algorithm.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.