#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

#137 in FFI

Download history 191/week @ 2024-09-18 125/week @ 2024-09-25 43/week @ 2024-10-02 54/week @ 2024-10-09 45/week @ 2024-10-16 22/week @ 2024-10-23 44/week @ 2024-10-30 23/week @ 2024-11-06 34/week @ 2024-11-13 53/week @ 2024-11-20 28/week @ 2024-11-27 16/week @ 2024-12-04 37/week @ 2024-12-11 25/week @ 2024-12-18 5/week @ 2024-12-25 77/week @ 2025-01-01

152 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