# biff
[![Crates.io][crates-badge]][crates-url]
[![MIT licensed][mit-badge]][mit-url]
[![Apache 2.0 licensed][apache-badge]][apache-url]
![build Linux][build-badge-linux]
![build Windows][build-badge-windows]
![build MacOs][build-badge-macos]
![Code coverage][coverage-badge]
[![Contributor Covenant][coc-badge]](https://github.com/senees/biff/blob/main/CODE_OF_CONDUCT.md)
[crates-badge]: https://img.shields.io/crates/v/biff.svg
[crates-url]: https://crates.io/crates/biff
[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg
[mit-url]: https://github.com/senees/biff/blob/main/LICENSE-MIT
[apache-badge]: https://img.shields.io/badge/License-Apache%202.0-blue.svg
[apache-url]: https://github.com/senees/biff/blob/main/LICENSE-APACHE
[build-badge-linux]: https://github.com/senees/biff/actions/workflows/build-linux.yml/badge.svg
[build-badge-windows]: https://github.com/senees/biff/actions/workflows/build-windows.yml/badge.svg
[build-badge-macos]: https://github.com/senees/biff/actions/workflows/build-macos.yml/badge.svg
[coverage-badge]: https://img.shields.io/badge/Coverage-100%25-green.svg
[coc-badge]: https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg
## Overview
Compare two files byte by byte.
**biff** compares two files byte by byte, and if they differ, tells the first byte and line number where they differ.
Additionally, when option **-l** or **--verbose** is set, **biff** will display all differing bytes.
**biff** may also skip some initial bytes in compared files or compare only up to requested number of bytes.
When comparing binary files, **biff** may check the beginning bytes if they match the specified _marker_, so only
files having such marker will be compared. There are also cases, when compared files differ only in few bytes,
but generally may be considered as _similar_ and this is quite alright. For such comparisons **biff** may use
the absolute total number of acceptable differences (option **-a** or **--absolute**) or percentage difference
(option **-p** or **--percent**). The most popular use case of such _similarity comparisons_ are PDF files generated
from the same HTML files using Headless Chrome.
The most popular place where **biff** is used are test cases that compare output values being files.
## Installation
```
$ cargo install biff
```
## Usage
Display shortened description:
```
$ biff -h
```
Display detailed description:
```
$ biff --help
```
## License
Licensed under either of
- [MIT license](https://opensource.org/licenses/MIT) ([LICENSE-MIT](https://github.com/senees/biff/blob/main/LICENSE-MIT)), or
- [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) ([LICENSE-APACHE](https://github.com/senees/biff/blob/main/LICENSE-APACHE))
at your option.
## Contribution
All contributions intentionally submitted for inclusion in the work by you,
shall be dual licensed as above, without any additional terms or conditions.