gospacedev / luhn

Luhn Module Verifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

luhn-formula

MIT Licence

Luhn Formula is a go module that uses the luhn aglorithm also known as Modulus 10 Algorithm to verify if a number is a luhn number

Usage

To get:

go get github.com/gospacedev/luhn-formula

You can use it as:

package main

import (
	"fmt"
	"github.com/gospacedev/luhn-formula"
)

func main() {
	a := luhn.Check("79927398713")
	b := luhn.Check("1111")
	fmt.Println(a)
	fmt.Println(b)
}

The output will be:

true
false

About

Luhn Module Verifier

License:MIT License


Languages

Language:Go 100.0%