8000 GitHub - triciatzy/luhn: Luhn algorithm in GO
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

triciatzy/luhn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luhn Algorithm

Generating check number & validating Luhn numbers in GO

Usage

import "github.com/triciatzy/luhn"

func main() {
	// Checking if a string is a valid luhn
	n1 := big.NewInt(1111)
	n2 := big.NewInt(79927398713)
	luhn.Valid(n1) //= false
	luhn.Valid(n2) //= true

	n3 := big.NewInt(7992739871)
  luhn.CalculateLuhn(n3) //= 3
}

About

Luhn algorithm in GO

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%
2AA7
0