use armour_core::const_hasher_or;
use harsh::Harsh;
use sqids::{Options, Sqids};

const HARSH_ALPHABET: &[u8] = b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
const SEPARATORS: &[u8] = b"cfhistuCFHISTU";

const_hasher_or!(
    test_key,
    "TEST",
    "_mKbKGF2IrkGvIJvl97HuCgWjgt6QRZ7Ye8DHBQ2anvyi18BdMz8uN6Ej3YJApooY6qDu0obqq4"
);

fn main() -> std::io::Result<()> {
    let harsh = Harsh::builder()
        .salt(b"asdasdasd")
        .length(3)
        .alphabet(HARSH_ALPHABET)
        .separators(SEPARATORS)
        .build()
        .unwrap();

    println!("generate 10 keys in hashids");
    for i in 20..30 {
        let val = harsh.encode(&[i]);
        println!("{val}");
    }

    let sqids = Sqids::new(Some(Options::new(
        Some("FxnXM1kBN6cuhsAvjW3Co7l2RePyY8DwaU04Tzt9fHQrqSVKdpimLGIJOgb5ZE".to_string()),
        Some(3),
        None,
    )))
    .unwrap();

    println!("generate 10 keys in sqids");
    for i in 20..30 {
        let val = sqids.encode(&[i]).unwrap();
        println!("{val}");
    }

    Ok(())
}
