New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bsdiff4

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bsdiff4

binary diff and patch using the BSDIFF4-format

  • 1.2.6
  • PyPI
  • Socket score

Maintainers
1

======================================================= bsdiff4: binary diff and patch using the BSDIFF4-format

The code is mostly derived from cx_bsdiff (written by Anthony Tuininga, http://cx-bsdiff.sourceforge.net/). The cx_bsdiff code in turn was derived from bsdiff, the standalone utility produced for BSD which can be found at http://www.daemonology.net/bsdiff. In addition to the two functions (diff and patch) cx_bsdiff provides, this package includes:

  • an interface to the BSDIFF4-format
  • command line interfaces: bsdiff4 and bspatch4
  • tests

The bsdiff4 package defines the following high level functions:

diff(src_bytes, dst_bytes) -> bytes Return a BSDIFF4-format patch (from src_bytes to dst_bytes) as bytes.

patch(src_bytes, patch_bytes) -> bytes Apply the BSDIFF4-format patch_bytes to src_bytes and return the bytes.

file_diff(src_path, dst_path, patch_path) Write a BSDIFF4-format patch (from the file src_path to the file dst_path) to the file patch_path.

file_patch(src_path, dst_path, patch_path) Apply the BSDIFF4-format file patch_path to the file src_path and write the result to the file dst_path.

file_patch_inplace(path, patch_path) Apply the BSDIFF4-format file patch_path to the file path in place.

Example:

.. code-block:: python

import bsdiff4 a = 100000 * b'a' b = bytearray(a) b[100:106] = b' diff ' p = bsdiff4.diff(a, bytes(b)) len(p) 154 bsdiff4.patch(a, p) == b True

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc