pub fn generate_code_standalone(
secret_key: &[u8; 32],
counter: u64,
alphabet_str: Option<&str>,
code_length: Option<usize>,
check_position: Option<CheckPosition>,
) -> StringExpand description
Generate a code with standalone parameters.
This is useful for testing or one-off generation without a .bin file.
§Arguments
secret_key- 32-byte secret keycounter- Counter valuealphabet_str- Alphabet string (default if None)code_length- Number of random characters (9 default)check_position- Check digit position (End default)
§Example
use promocrypt_core::{generate_code_standalone, CheckPosition};
let secret = [0u8; 32];
let code = generate_code_standalone(&secret, 0, None, None, None);
assert_eq!(code.len(), 10);