use slugencode::prelude::*;
use slugencode::SlugEncoder;
use slugencode::SlugDecoder;
fn main() {
let data = "Hi Mom, im on the internet!";
let slugencoding = SlugEncodingUsage::new(SlugEncodings::Hex);
let encoded = slugencoding.encode(data.as_bytes());
let decoded = slugencoding.decode(&encoded.unwrap()).expect("Decoding failed");
let quote_of_the_day:&'static str = "The only limit to our realization of tomorrow is our doubts of today.";
let base32 = quote_of_the_day.as_bytes().to_bs32();
assert_eq!(quote_of_the_day.as_bytes().to_bs32(), "krugkidpnzwhsidmnfwws5baorxsa33voiqhezlbnruxuylunfxw4idpmyqhi33nn5zhe33xebuxgidpovzcazdpovrhi4zan5tca5dpmrqxslq=");
println!("Base32: {}", base32);
}
fn decode() {
let message_224: &str = "4b046cf780d891526710c8fdcab78e1f35c188fc278221f330bcaec2";
message_224.from_hex().expect("Decoding failed");
let slugencoding = SlugEncodingUsage::new(SlugEncodings::Hex);
let decoded = slugencoding.decode(message_224).expect("Decoding failed");
println!("Decoded: {:?}", decoded);
}