#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

#123 in FFI

Download history 184/week @ 2024-07-22 144/week @ 2024-07-29 225/week @ 2024-08-05 197/week @ 2024-08-12 230/week @ 2024-08-19 202/week @ 2024-08-26 195/week @ 2024-09-02 40/week @ 2024-09-09 35/week @ 2024-09-16 262/week @ 2024-09-23 60/week @ 2024-09-30 47/week @ 2024-10-07 44/week @ 2024-10-14 33/week @ 2024-10-21 44/week @ 2024-10-28 25/week @ 2024-11-04

148 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