is_valid

Function is_valid 

Source
pub fn is_valid(
    code: &str,
    alphabet: &Alphabet,
    expected_length: usize,
    damm_table: &DammTable,
) -> bool
Expand description

Quick boolean validation check.

Returns true if the code is valid, false otherwise. Use validate() if you need details about why validation failed.

ยงExample

use promocrypt_core::{is_valid, Alphabet, DammTable};

let alphabet = Alphabet::default_alphabet();
let damm = DammTable::new(alphabet.len());

let valid = is_valid("SOMECODE", &alphabet, 10, &damm);