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

okid

A library for gereating double clickable ids

21 releases (4 breaking)

0.5.3 Nov 21, 2024
0.5.2 Nov 21, 2024
0.4.2 Nov 10, 2024
0.3.0 Nov 10, 2024
0.1.37 Oct 21, 2024

#271 in Cryptography

Download history 198/week @ 2024-09-28 356/week @ 2024-10-05 221/week @ 2024-10-12 227/week @ 2024-10-19 13/week @ 2024-10-26 297/week @ 2024-11-02 494/week @ 2024-11-09 661/week @ 2024-11-16 75/week @ 2024-11-23 187/week @ 2024-11-30

1,504 downloads per month

BSD-3-Clause

735KB
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

~12–28MB
~414K SLoC