Function checkluhn::validate[][src]

pub fn validate(value: &str) -> bool

Validates the given number for Luhn Algorithm. Ref: https://en.wikipedia.org/wiki/Luhn_algorithm#:~:text=The%20Luhn%20algorithm%20or%20Luhn,Provider%20Identifier%20numbers%20in%20the

Example Usage

use checkluhn::validate;

fn main() {
let n = "4111111111111111";
    assert!(validate(n))
}