valid

package
v0.0.0-...-24939ff Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCreditCard

func IsCreditCard(str string) bool

IsCreditCard applies regular expression and luhn algorithm validation to validate the correct structure of a payment card number.

inspired by Alex Saskevich `govalidator` package: ref: https://github.com/asaskevich/govalidator

func Luhn

func Luhn(s string) bool

Luhn implements the Luhn checksum formula that validates identification numbers. It was designed to protect against accidental errors, not malicious attacks.

https://en.wikipedia.org/wiki/Luhn_algorithm

Types

This section is empty.

Jump to

Keyboard shortcuts

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