armour 0.30.27

DDL and serialization for key-value storage
Documentation
use armour::const_hasher;
use harsh::Harsh;
use sqids::{Options, Sqids};

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

const_hasher!(test_key, "TEST");

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(())
}