package patdiff

  1. Overview
  2. Docs
File Diff using the Patience Diff algorithm

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=f4f2b060ea39870e238f5be744e84d1d8030864a02f8fc2368866e4d3d7e1b72

doc/src/patdiff.kernel/is_binary.ml.html

Source file is_binary.ml

1
2
3
4
5
6
7
8
9
open! Core
open! Import

(* The choice of 8000 bytes is copied from git:

   https://github.com/git/git/blob/b7bd9486b055c3f967a870311e704e3bb0654e4f/xdiff-interface.c#L201
*)
let prefix_length = 8000
let string s = String.contains s '\000' ~len:(Int.min prefix_length (String.length s))
OCaml

Innovation. Community. Security.