#sha-1 #representation #data #uuid #hash #ids #double

okid

A library for gereating double clickable ids

25 releases (5 breaking)

0.6.2 Feb 2, 2025
0.5.5 Jan 17, 2025
0.5.3 Nov 21, 2024

#389 in Cryptography

Download history 188/week @ 2024-10-20 6/week @ 2024-10-27 331/week @ 2024-11-03 470/week @ 2024-11-10 688/week @ 2024-11-17 38/week @ 2024-11-24 314/week @ 2024-12-01 397/week @ 2024-12-08 95/week @ 2024-12-15 59/week @ 2024-12-22 56/week @ 2024-12-29 90/week @ 2025-01-05 123/week @ 2025-01-12 126/week @ 2025-01-19 113/week @ 2025-01-26 164/week @ 2025-02-02

535 downloads per month

BSD-3-Clause

750KB
1K SLoC

okid

okid is a library for generating double clickable representations of various types of data, such as sha1 hashes, uuids and more.

sha1

#[cfg(feature = "sha1")]
{
    use sha1::Digest as sha1digest;
    let hasher = sha1::Sha1::new();
    let binary_id = okid::OkId::from(hasher);
}

sha256

#[cfg(feature = "sha2")]
{
    use sha2::Digest;
    let mut hasher = sha2::Sha256::new();
    hasher.update(b"hello world");
    let binary_id = okid::OkId::from(hasher);
}

The resulting strings look like this: 2ː00b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 first character of the string is the type of the binary data in this case 2 means sha256 the rest of the string is the hexadecimal representation of the binary data

Dependencies

~4–19MB
~298K SLoC