{"id":20733130,"url":"https://github.com/ping/srihash","last_synced_at":"2025-12-25T01:13:52.562Z","repository":{"id":85767098,"uuid":"91782111","full_name":"ping/srihash","owner":"ping","description":"bash function/script to generate an SRI hash for a remote resource","archived":false,"fork":false,"pushed_at":"2017-05-19T09:21:42.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-11T10:45:32.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/ping.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2017-05-19T08:08:16.000Z","updated_at":"2025-02-01T22:17:27.000Z","dependencies_parsed_at":"2023-03-05T01:30:31.486Z","dependency_job_id":null,"html_url":"https://github.com/ping/srihash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ping/srihash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ping%2Fsrihash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ping%2Fsrihash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ping%2Fsrihash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ping%2Fsrihash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ping","download_url":"https://codeload.github.com/ping/srihash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ping%2Fsrihash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28015136,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-17T05:23:38.216Z","updated_at":"2025-12-25T01:13:52.548Z","avatar_url":"https://github.com/ping.png","language":"Shell","readme":"# srihash\nbash function/script to generate an SRI hash for a remote resource\n\n## Install\nNot much of an install. Use either the bash function or script version.\n\nRequires ``openssl``.\n\n### 1. bash function\nAdd the ``srihash`` function to ``~/.bash_profile``\n\n```bash\ncurl -sL 'https://raw.githubusercontent.com/ping/srihash/master/srihash' \u003e\u003e ~/.bash_profile \\\n\u0026\u0026 source ~/.bash_profile\n```\n\n### 2. bash script\nDownload ``srihash.sh`` locally.\n\n```bash\ncurl -s -o 'srihash.sh' 'https://raw.githubusercontent.com/ping/srihash/master/srihash.sh' \\\n\u0026\u0026 chmod +x srihash.sh\n```\n\n## Usage\n\n```bash\nsrihash 'https://url/to/a.css' 'https://url/to/another.js'\n# or\n./srihash.sh 'https://url/to/a.css' 'https://url/to/another.js'\n\n# Use sha256 instead\nsrihash 'sha256' 'https://url/to/a.css' 'https://url/to/another.js'\n# or\n./srihash.sh 'sha256' 'https://url/to/a.css' 'https://url/to/another.js'\n\n# Use sha512 instead\nsrihash 'sha512' 'https://url/to/a.css' 'https://url/to/another.js'\n# or\n./srihash.sh 'sha512' 'https://url/to/a.css' 'https://url/to/another.js'\n```\n\nExample:\n\n```bash\nsrihash 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css' \\\n'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js'\n```\n```\n==== Generating hash for: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css ====\nsha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\n\u003clink rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css\"\n integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\"\n crossorigin=\"anonymous\"\u003e\n==== Generating hash for: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js ====\nsha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js\"\n integrity=\"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa\"\n crossorigin=\"anonymous\"\u003e\u003c/script\u003e\n```\n\nThe generated ``\u003cscript\u003e``/``\u003clink\u003e`` markup will automatically be copied to the clipboard.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fping%2Fsrihash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fping%2Fsrihash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fping%2Fsrihash/lists"}