{"id":33939119,"url":"https://github.com/chksum-rs/lib","last_synced_at":"2026-04-08T19:30:59.861Z","repository":{"id":187754546,"uuid":"565312259","full_name":"chksum-rs/lib","owner":"chksum-rs","description":"An implementation of various hash functions with a straightforward interface for computing digests of bytes, files, directories, and more.","archived":false,"fork":false,"pushed_at":"2025-01-02T18:34:30.000Z","size":51,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-02T06:17:42.997Z","etag":null,"topics":["cryptography","digest","hash","rust","rust-crate"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chksum-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-11-13T01:33:07.000Z","updated_at":"2025-09-25T23:18:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc1e7e93-2e87-46af-9846-9cb293cdbd29","html_url":"https://github.com/chksum-rs/lib","commit_stats":null,"previous_names":["ferric-bytes/chksum","chksum-rs/lib"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/chksum-rs/lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chksum-rs%2Flib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chksum-rs%2Flib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chksum-rs%2Flib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chksum-rs%2Flib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chksum-rs","download_url":"https://codeload.github.com/chksum-rs/lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chksum-rs%2Flib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","digest","hash","rust","rust-crate"],"created_at":"2025-12-12T15:13:32.049Z","updated_at":"2026-04-08T19:30:59.853Z","avatar_url":"https://github.com/chksum-rs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chksum\n\n[![crates.io](https://img.shields.io/crates/v/chksum?style=flat-square\u0026logo=rust \"crates.io\")](https://crates.io/crates/chksum)\n[![Build](https://img.shields.io/github/actions/workflow/status/chksum-rs/lib/rust.yml?branch=master\u0026style=flat-square\u0026logo=github \"Build\")](https://github.com/chksum-rs/lib/actions/workflows/rust.yml)\n[![docs.rs](https://img.shields.io/docsrs/chksum?style=flat-square\u0026logo=docsdotrs \"docs.rs\")](https://docs.rs/chksum/)\n[![MSRV](https://img.shields.io/badge/MSRV-1.74.0-informational?style=flat-square \"MSRV\")](https://github.com/chksum-rs/lib/blob/master/Cargo.toml)\n[![deps.rs](https://deps.rs/crate/chksum/0.4.0/status.svg?style=flat-square \"deps.rs\")](https://deps.rs/crate/chksum/0.4.0)\n[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg?style=flat-square \"unsafe forbidden\")](https://github.com/rust-secure-code/safety-dance)\n[![LICENSE](https://img.shields.io/github/license/chksum-rs/lib?style=flat-square \"LICENSE\")](https://github.com/chksum-rs/lib/blob/master/LICENSE)\n\nAn implementation of various hash functions with a straightforward interface for computing digests of bytes, files, directories, and more.\n\n## Setup\n\nTo use this crate, add the following entry to your `Cargo.toml` file in the `dependencies` section:\n\n```toml\n[dependencies]\nchksum = \"0.4.0\"\n```\n\nAlternatively, you can use the [`cargo add`](https://doc.rust-lang.org/cargo/commands/cargo-add.html) subcommand:\n\n```shell\ncargo add chksum\n```\n\n## Usage\n\nUse the `chksum` function with the desired algorithm to calculate digest of file, directory and so on.\n\n```rust\nuse chksum::{chksum, SHA2_256};\n\nlet file = File::open(path)?;\nlet digest = chksum::\u003cSHA2_256\u003e(file)?;\nassert_eq!(\n    digest.to_hex_lowercase(),\n    \"44752f37272e944fd2c913a35342eaccdd1aaf189bae50676b301ab213fc5061\"\n);\n```\n\nAlternatively, use the `chksum` function directly from the chosen hash module.\n\n```rust\nuse chksum::sha2_256;\n\nlet file = File::open(path)?;\nlet digest = sha2_256::chksum(file)?;\nassert_eq!(\n    digest.to_hex_lowercase(),\n    \"44752f37272e944fd2c913a35342eaccdd1aaf189bae50676b301ab213fc5061\"\n);\n```\n\nFor more usage examples, refer to the documentation available at [docs.rs](https://docs.rs/chksum/).\n\n### Asynchronous Runtime\n\nUse `async-runtime-tokio` feature to enable Tokio asynchronous runtime.\n\n```shell\ncargo add chksum --features async-runtime-tokio\n```\n\nUse the `async_chksum` function with the desired algorithm to calculate digest of file, directory and so on.\n\n```rust\nuse chksum::{async_chksum, SHA2_256};\nuse tokio::fs::File;\n\nlet file = File::open(path)?.await;\nlet digest = chksum::\u003cSHA2_256\u003e(file)?.await;\nassert_eq!(\n    digest.to_hex_lowercase(),\n    \"44752f37272e944fd2c913a35342eaccdd1aaf189bae50676b301ab213fc5061\"\n);\n```\n\nAlternatively, use the `async_chksum` function directly from the chosen hash module.\n\n```rust\nuse chksum::sha2_256;\n\nlet file = File::open(path)?;\nlet digest = sha2_256::async_chksum(file)?;\nassert_eq!(\n    digest.to_hex_lowercase(),\n    \"44752f37272e944fd2c913a35342eaccdd1aaf189bae50676b301ab213fc5061\"\n);\n```\n\nFor more usage examples, refer to the documentation available at [docs.rs](https://docs.rs/chksum/).\n\n## Hash Algorithms\n\nThis crate provides implementations for the following hash algorithms:\n\n* MD5 - [RFC 1321: The MD5 Message-Digest Algorithm](https://tools.ietf.org/html/rfc1321)\n* SHA-1 - [RFC 3174: US Secure Hash Algorithm 1 (SHA1)](https://tools.ietf.org/html/rfc3174)\n* SHA-2 family (SHA-224, SHA-256, SHA-386, SHA-512) - [FIPS PUB 180-4: Secure Hash Standard](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf)\n\n## Features\n\n### Algorithms\n\nCargo features are utilized to enable or disable specific hash algorithms.\n\n* `md5`: Enables MD5 hash algorithm.\n* `sha1`: Enables SHA-1 hash algorithm.\n* `sha2`: Enables SHA-2 hash family algorithms.\n  * `sha2-224`: Enables only SHA-2 224 hash algorithm.\n  * `sha2-256`: Enables only SHA-2 256 hash algorithm.\n  * `sha2-384`: Enables only SHA-2 384 hash algorithm.\n  * `sha2-512`: Enables only SHA-2 512 hash algorithm.\n\nBy default, all of them are enabled.\n\n### Extra Options\n\nCargo features are also utilized to enable extra options.\n\n* `reader` enables the `reader` module with the `Reader` struct within each variant module.\n* `writer` enables the `writer` module with the `Writer` struct within each variant module.\n\nBy default, neither of these features is enabled.\n\n### Asynchronous Runtime\n\n* `async-runtime-tokio`: Enables async interface for Tokio runtime.\n\nBy default, neither of these features is enabled.\n\n## License\n\nThis crate is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchksum-rs%2Flib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchksum-rs%2Flib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchksum-rs%2Flib/lists"}