VgsLuhnAlgorithmValidator

class VgsLuhnAlgorithmValidator(val errorMsg: String = ERROR_MESSAGE) : VgsTextFieldValidator

Validator that checks a numeric value against the Luhn checksum algorithm.

Commonly applied to card numbers to catch typos before submission.

Parameters

errorMsg

message returned when the value fails the Luhn check.

Constructors

Link copied to clipboard
constructor(errorMsg: String = ERROR_MESSAGE)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Result(val isValid: Boolean, val errorMsg: String? = null) : VgsTextFieldValidationResult

Properties

Link copied to clipboard
open override val errorMsg: String