Crate hash_ids

Source
Expand description

§hash-ids

A fast, dependency-free implementation for hashids.

§Usage

fn main() {
    let hash_ids = hash_ids::HashIds::builder()
        .with_salt("Arbitrary string")
        .finish();
    assert_eq!("neHrCa", hash_ids.encode(&[1, 2, 3]));
    match hash_ids.decode("neHrCa"){
        Ok(decode)=>{ assert_eq!(vec![1, 2, 3], decode); }
        Err(e)=>{ println!("{}",e); }
    }
}

Structs§

HashIds
The encoder/decoder container
HashIdsBuilder
Builder for HashIds
HashIdsBuilderWithCustomAlphabet
Same as HashIdsBuilder, but with custom alphabet (which can fail)

Enums§

Error
Error container for various errors