#id-generator #generator #id

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

#9 in #id-generator

Download history 171/week @ 2025-09-11 220/week @ 2025-09-18 205/week @ 2025-09-25 174/week @ 2025-10-02 227/week @ 2025-10-09 224/week @ 2025-10-16 121/week @ 2025-10-23 167/week @ 2025-10-30 155/week @ 2025-11-06 142/week @ 2025-11-13 87/week @ 2025-11-20 140/week @ 2025-11-27 171/week @ 2025-12-04 110/week @ 2025-12-11 112/week @ 2025-12-18 57/week @ 2025-12-25

485 downloads per month
Used in 2 crates

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]));
match hash_ids.decode("neHrCa"){
Ok(decode)=>{ assert_eq!(vec![1, 2, 3], decode); }
Err(e)=>{ println!("{}",e); }
}
}

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

No runtime deps