#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

#134 in FFI

Download history 48/week @ 2024-11-25 11/week @ 2024-12-02 38/week @ 2024-12-09 32/week @ 2024-12-16 6/week @ 2024-12-23 48/week @ 2024-12-30 67/week @ 2025-01-06 116/week @ 2025-01-13 88/week @ 2025-01-20 78/week @ 2025-01-27 71/week @ 2025-02-03 69/week @ 2025-02-10 67/week @ 2025-02-17 91/week @ 2025-02-24 167/week @ 2025-03-03 79/week @ 2025-03-10

409 downloads per month
Used in uuinfo

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