validate_code

Function validate_code 

Source
pub fn validate_code(
    code: &str,
    alphabet_str: &str,
    code_length: usize,
) -> ValidationResult
Expand description

Validate a code without opening a .bin file.

This is useful for quick validation with known parameters.

§Arguments

  • code - The code to validate
  • alphabet_str - Alphabet string
  • code_length - Expected code length (including check digit)

§Example

use promocrypt_core::{validate_code, ValidationResult};

let result = validate_code("ABCDEFGHIJ", "0234679ABCDEFGHJKMNPQRTUXY", 10);
// result is ValidationResult::Valid or indicates the error