luhn

package module
v0.0.0-...-6f5d426 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2022 License: MIT Imports: 1 Imported by: 4

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(cardNo string) bool

Checks if the string is a luhn number

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL