Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 288 Bytes

README.md

File metadata and controls

17 lines (12 loc) · 288 Bytes

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
}