{"id":15649673,"url":"https://github.com/zkat/ssri-rs","last_synced_at":"2025-04-13T08:40:36.433Z","repository":{"id":57668469,"uuid":"186765202","full_name":"zkat/ssri-rs","owner":"zkat","description":"Rusty implementation of Subresource Integrity","archived":false,"fork":false,"pushed_at":"2024-06-14T07:48:56.000Z","size":201,"stargazers_count":38,"open_issues_count":5,"forks_count":8,"subscribers_count":4,"default_branch":"latest","last_synced_at":"2025-03-27T00:13:32.002Z","etag":null,"topics":["hashing","subresource-integrity"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ssri","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zkat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["zkat"]}},"created_at":"2019-05-15T06:42:48.000Z","updated_at":"2024-06-30T02:11:18.000Z","dependencies_parsed_at":"2023-02-17T08:46:16.170Z","dependency_job_id":"16269a69-7420-4b37-807c-78cba2c922b3","html_url":"https://github.com/zkat/ssri-rs","commit_stats":{"total_commits":110,"total_committers":4,"mean_commits":27.5,"dds":0.09999999999999998,"last_synced_commit":"cc185ee8ded7653ee9be1d33ee964b64aa81ad67"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fssri-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fssri-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fssri-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fssri-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zkat","download_url":"https://codeload.github.com/zkat/ssri-rs/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248685872,"owners_count":21145378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hashing","subresource-integrity"],"created_at":"2024-10-03T12:30:48.854Z","updated_at":"2025-04-13T08:40:36.399Z","avatar_url":"https://github.com/zkat.png","language":"Rust","funding_links":["https://github.com/sponsors/zkat"],"categories":[],"sub_categories":[],"readme":"# ssri\n\n[`ssri`](https://github.com/zkat/ssri-rs), short for Standard Subresource\nIntegrity, is a Rust library for parsing, manipulating, serializing,\ngenerating, and verifying [Subresource Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/)\nhashes.\n\n## Example\n\nParse a string as [`Integrity`](struct.Integrity.html) to convert it to a struct:\n\n```rust\nuse ssri::Integrity;\n\nlet source = \"sha256-uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek=\";\n\nlet parsed: Integrity = source.parse().unwrap();\nassert_eq!(parsed.to_string(), source)\n```\n\nGenerating a new hash from file data:\n\n```rust\nuse ssri::Integrity;\n\n// By default, generates Integrity as Sha256.\n// Use IntegrityOpts to pick the algorithm yourself.\nlet sri = Integrity::from(b\"hello world\");\nassert_eq!(sri.to_string(), \"sha256-uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek=\");\n```\n\nVerifying data against an SRI:\n\n```rust\nuse ssri::{Integrity, Algorithm};\n\nlet sri = Integrity::from(b\"hello world\");\nassert_eq!(sri.check(b\"hello world\").unwrap(), Algorithm::Sha256);\n```\n\nYou can also use [`IntegrityOpts`](struct.IntegrityOpts.html) and [`IntegrityChecker`](struct.IntegrityChecker.html) to generate\nand check subresource integrity, respectively. These allow things like multiple algorithms, and\nincremental/streamed data input.\n\n## Install\n\nUsing [`cargo-edit`](https://crates.io/crates/cargo-edit)\n\n`$ cargo add ssri`\n\n## Documentation\n\n- [API Docs](https://docs.rs/ssri)\n\n## Features\n\n- Parses and stringifies [Subresource Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) strings.\n- Generates SRI strings from raw data.\n- Strict standard compliance.\n- Multiple entries for the same algorithm.\n\n## Contributing\n\nThe ssri team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The [Contributor Guide](CONTRIBUTING.md) has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.\n\nAll participants and maintainers in this project are expected to follow [Code of Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other.\n\nHappy hacking!\n\n## License\n\nThis project is licensed under [the Apache-2.0 License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Fssri-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzkat%2Fssri-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Fssri-rs/lists"}