{"id":42493256,"url":"https://github.com/icedream/go-bsdiff","last_synced_at":"2026-01-28T12:31:54.374Z","repository":{"id":28388565,"uuid":"82210011","full_name":"icedream/go-bsdiff","owner":"icedream","description":"Golang wrapper for @mendsley's bsdiff C library.","archived":false,"fork":false,"pushed_at":"2025-11-01T02:02:04.000Z","size":2460,"stargazers_count":26,"open_issues_count":4,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-01T04:06:13.236Z","etag":null,"topics":["binary-diffing","bsdiff","go","golang","golang-library","patch"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icedream.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-02-16T18:00:50.000Z","updated_at":"2025-11-01T02:01:14.000Z","dependencies_parsed_at":"2023-11-16T05:25:11.438Z","dependency_job_id":"9c0d727d-630d-4015-9d99-4be0d63eabd3","html_url":"https://github.com/icedream/go-bsdiff","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/icedream/go-bsdiff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icedream%2Fgo-bsdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icedream%2Fgo-bsdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icedream%2Fgo-bsdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icedream%2Fgo-bsdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icedream","download_url":"https://codeload.github.com/icedream/go-bsdiff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icedream%2Fgo-bsdiff/sbom","scorecard":{"id":479943,"data":{"date":"2025-08-11","repo":{"name":"github.com/icedream/go-bsdiff","commit":"9c8daf35d3363e071ac4a75759800818b062651d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/icedream/go-bsdiff/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/icedream/go-bsdiff/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/icedream/go-bsdiff/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/icedream/go-bsdiff/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/icedream/go-bsdiff/test.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T16:21:14.144Z","repository_id":28388565,"created_at":"2025-08-19T16:21:14.144Z","updated_at":"2025-08-19T16:21:14.144Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"last_error":"SSL_read: 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":["binary-diffing","bsdiff","go","golang","golang-library","patch"],"created_at":"2026-01-28T12:31:53.893Z","updated_at":"2026-01-28T12:31:54.368Z","avatar_url":"https://github.com/icedream.png","language":"C","readme":"# bsdiff for Go\n\nThis wrapper implementation for Golang reuses the existing\nC version of bsdiff as provided by @mendsley and wraps it\ninto a Go package, abstracting away all the cgo work that\nwould need to be done otherwise.\n\n## Installation\n\nThe library and the helper binaries `go-bsdiff` and `go-bspatch` can be installed like this:\n\n    go get -v github.com/icedream/go-bsdiff/...\n\n## Usage in application code\n\nFor exact documentation of the library check out [GoDoc](https://godoc.org/github.com/icedream/go-bsdiff).\n\nLibrary functionality is provided both as a package `bsdiff` containing both\nmethods `Diff` and `Patch`, or as subpackages `diff` and `patch` which each\nonly link the wanted functionality.\n\nBelow example will generate a patch and apply it again in one go. This code\nis not safe against errors but it shows how to use the provided routines:\n\n```go\npackage main\n\nimport (\n    \"os\"\n    \"github.com/icedream/go-bsdiff\"\n    // Or use the subpackages to only link what you need:\n    //\"github.com/icedream/go-bsdiff/diff\"\n    //\"github.com/icedream/go-bsdiff/patch\"\n)\n\nconst (\n    oldFilePath = \"your_old_file.dat\"\n    newFilePath = \"your_new_file.dat\"\n    patchFilePath = \"the_generated.patch\"\n)\n\nfunc generatePatch() error {\n    oldFile, _ := os.Open(oldFilePath)\n    defer oldFile.Close()\n    newFile, _ := os.Open(newFilePath)\n    defer newFile.Close()\n    patchFile, _ := os.Create(patchFilePath)\n    defer patchFile.Close()\n\n    return bsdiff.Diff(oldFile, newFile, patchFile)\n}\n\nfunc applyPatch() error {\n    oldFile, _ := os.Open(oldFilePath)\n    defer oldFile.Close()\n    newFile, _ := os.Create(newFilePath)\n    defer newFile.Close()\n    patchFile, _ := os.Open(patchFilePath)\n    defer patchFile.Close()\n\n    return bsdiff.Patch(oldFile, newFile, patchFile)\n}\n\nfunc main() {\n    generatePatch()\n    applyPatch()\n}\n```\n\n## Usage of the tools\n\nThe tools `go-bsdiff` and `go-bspatch` both provide a `--help` flag to print\nout all information but in their simplest form, they can be used like this:\n\n```sh\n# Creates a patch file $the_generated with differences from\n# $your_old_file to $your_new_file.\ngo-bsdiff \"$your_old_file\" \"$your_new_file\" \"$the_generated\"\n\n# Applies a patch file $the_generated on $your_old_file\n# and saves the new file to $your_new_file.\ngo-bspatch \"$your_old_file\" \"$your_new_file\" \"$the_generated\"\n```\n\n## Motivation\n\nThere is [a Go implementation of an older version of bsdiff called binarydist](https://github.com/kr/binarydist). The original bsdiff tool has since been updated so patches generating using the original tool are no longer compatible with the Go implementation. I don't know what the changes between the versions are and unfortunately I don't have the time to search for these changes and port them over as a pull request, otherwise I'd have done that instead.\n\nAdditionally, @mendsley has already done the extra work of rewriting the code to be embeddable in any application code as a library. So why not make use of cgo, which I was going to look into in more detail at some point anyways?\n\nBy now, there is also [TotallyGamerJet's purely Go implementation of bsdiff 4](https://github.com/TotallyGamerJet/bsdiff). It does not rely on cgo at all and may suit your use-case better.\n\n## License\n\nJust like bsdiff, this project is licensed under the 2-clause BSD license (or Simplified BSD license). You can check [LICENSE.txt](LICENSE.txt) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficedream%2Fgo-bsdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficedream%2Fgo-bsdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficedream%2Fgo-bsdiff/lists"}