#id-generator #id #generator #string #org

hash-ids

a fast hashids (hashids.org) implementation

4 releases (2 breaking)

0.3.1 Sep 23, 2024
0.2.1 May 14, 2020
0.2.0 May 14, 2020
0.1.0 May 12, 2020

#132 in FFI

Download history 244/week @ 2024-08-17 187/week @ 2024-08-24 177/week @ 2024-08-31 83/week @ 2024-09-07 39/week @ 2024-09-14 253/week @ 2024-09-21 69/week @ 2024-09-28 48/week @ 2024-10-05 44/week @ 2024-10-12 37/week @ 2024-10-19 38/week @ 2024-10-26 30/week @ 2024-11-02 16/week @ 2024-11-09 50/week @ 2024-11-16 48/week @ 2024-11-23 14/week @ 2024-11-30

135 downloads per month

MIT/Apache

22KB
407 lines

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]));
    assert_eq!(vec![1, 2, 3], hash_ids.decode("neHrCa"));
}

lib.rs:

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

No runtime deps