No description
Find a file
2025-01-21 13:21:19 +00:00
.github feat: node id 2024-11-20 16:09:00 +00:00
docs/src feat: release 0.1~ 2024-11-06 11:07:40 +00:00
src feat: try from okid 2025-01-21 13:21:19 +00:00
.gitignore first commit 2024-11-06 11:06:01 +00:00
.release-please-manifest.json chore(main): release 0.5.4 2025-01-17 16:16:39 +00:00
book.toml Initial commit 2024-11-06 11:02:20 +00:00
Cargo.lock fix: update 2025-01-17 16:24:35 +00:00
Cargo.toml chore(deps): bump bytes from 1.8.0 to 1.9.0 2025-01-17 16:20:22 +00:00
CHANGELOG.md chore(main): release 0.5.4 2025-01-17 16:16:39 +00:00
README.md fix: Update README.md feature flag 2024-11-20 16:21:26 +00:00
release-please-config.json Update release-please-config.json 2024-11-08 01:35:43 +00:00

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