Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ea5a3a9
Add BLAKE3 hash support with .bk3 format
sarsolot Jan 25, 2026
c046c3a
Remove bk3-* aliases and add b3sum compatibility tests
sarsolot Jan 31, 2026
9a21396
Improve BLAKE3 missing dependency handling and add standard tests
sarsolot Feb 1, 2026
c3f9a97
Refactor: move exceptions to dedicated module and blake3 to hash.py
sarsolot Feb 1, 2026
d7ae474
Remove unused CFError exception class
lxp Feb 7, 2026
7b9cbd9
Re-order exception classes
lxp Feb 7, 2026
d97c6e7
Improve BK3 b3sum compatibility and fix minor issues
sarsolot Feb 7, 2026
cf669f3
Reuse _getfilechecksum in getfileblake3 for mmap support
sarsolot Feb 7, 2026
4657719
Fix flake8 E731: use def instead of lambda assignment in _getfilechec…
sarsolot Feb 7, 2026
d27563e
CI: Remove unused wheel package
lxp Feb 7, 2026
5157f1c
CI: Move CI dependencies to pyproject.toml
lxp Feb 7, 2026
fb778db
CI: Run linting steps only in separate job with latest Python version
lxp Feb 7, 2026
da9bfed
Add optional dependencies to pyproject.toml
lxp Feb 7, 2026
32c53f4
CI: Run unit and integration tests also with optional dependencies in…
lxp Feb 7, 2026
ea47aa6
Add optional blake3 dependency
lxp Feb 8, 2026
696eea0
CI: Install b3sum test dependency
lxp Feb 8, 2026
319cf36
Fix syntax error in pyproject.toml
lxp Feb 8, 2026
a022c06
CI: Allow failures for optional dependencies on Python 3.15
lxp Feb 8, 2026
cf16a21
Simplify BLAKE3 to single b3 type with .b3 extension and --length option
sarsolot Feb 23, 2026
883f652
Merge branch 'feature/blake3' of github.com:sarsolot/cfv into feature…
sarsolot Mar 3, 2026
2e594e5
Simplify getfilehash usage by allowing arbitrary additional parameter…
lxp Mar 8, 2026
5240dfa
Align BLAKE3 auto_filename_match with other filename matching functions
lxp Mar 8, 2026
bfc300e
Minor refactoring of BLAKE3 format
lxp Mar 8, 2026
67086b8
Update BLAKE3 auto-detection order
lxp Mar 8, 2026
17474dc
Add other BLAKE3 tests similar to coreutils formats
lxp Mar 8, 2026
f12fa11
Minor renamings
lxp Mar 8, 2026
0bb3dce
Add changelog entry for BLAKE3
lxp Mar 8, 2026
9ec8155
Better align README, man page and help text
lxp Mar 8, 2026
9eb99fc
Add TurboSFV header to test.bk3 fixture
sarsolot Mar 9, 2026
1025bcf
Change --length from bytes to bits
sarsolot Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions .github/workflows/ci-python3-freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
release: ${{ matrix.freebsd-release }}
usesh: true
prepare: pkg install -y python3 devel/py-pip coreutils cksfv git-tiny rust
prepare: pkg install -y python3 devel/py-pip coreutils cksfv b3sum git-tiny rust
run: |
set -ex

Expand All @@ -55,15 +55,6 @@ jobs:
pw groupadd docker -g 127
pw useradd runner -u 1001 -g docker

# Install test dependencies
pip install pyroma
pip install check-manifest
pip install twine
pip install wheel
pip install flake8
pip install build
pip list

# Check syntax by compiling code
python -W error -bb -m compileall -f .

Expand All @@ -76,15 +67,25 @@ jobs:
# Run integration tests (external process)
su runner -c 'ulimit -n; ulimit -n 4096; test/test.py -e --exit-early'

# Check package quality
su runner -c 'pyroma -n 10 .'
# Install optional dependencies
# pillow dependencies
pkg install -y jpeg-turbo tiff webp openjpeg libavif
pip install .[full]
pip list

# Check the completeness of MANIFEST.in
su runner -c 'check-manifest .'
# Run unit tests (with optional dependencies)
su runner -c 'python -W error -bb test/test.py --unit --exit-early'

# Run flake
flake8 --exclude=build,venv --ignore= --max-line-length=200 --max-complexity=75 --show-source --statistics .
# Run integration tests (internal, with optional dependencies)
su runner -c 'ulimit -n; ulimit -n 4096; python -W error -bb test/test.py -i --exit-early'

# Run integration tests (external process, with optional dependencies)
su runner -c 'ulimit -n; ulimit -n 4096; test/test.py -e --exit-early'

# Install build dependencies
# Fallback hack required for pip < 25.1 (since newer pip is not available for Python < 3.9)
pip install --group build || pip install build
pip list

# Check distribution
# Build
python -m build
twine check dist/*
81 changes: 63 additions & 18 deletions .github/workflows/ci-python3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,41 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
lint:
# The type of runner that the job will run on
runs-on: ubuntu-24.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.15'
allow-prereleases: true
check-latest: true

- name: Install lint dependencies
run: |
pip install --group ci
pip list

- name: Run flake
run: flake8 --exclude=build,venv --ignore= --max-line-length=200 --max-complexity=75 --show-source --statistics .

- name: Check package quality
run: pyroma -n 10 .

- name: Check the completeness of MANIFEST.in
run: check-manifest .

- name: Check distribution
run: |
python -m build
twine check dist/*

test:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -45,14 +79,7 @@ jobs:

- name: Install test dependencies
run: |
sudo apt install coreutils cksfv
pip install pyroma
pip install check-manifest
pip install twine
pip install wheel
pip install flake8
pip install build
pip list
sudo apt install coreutils cksfv b3sum

- name: Check syntax by compiling code
run: python -W error -bb -m compileall -f .
Expand All @@ -72,17 +99,35 @@ jobs:
ulimit -n 4096
test/test.py -e --exit-early

- name: Check package quality
continue-on-error: ${{ contains(fromJson('["3.7", "3.8"]'), matrix.python-version) }}
run: pyroma -n 10 .
- name: Install optional dependencies
continue-on-error: ${{ contains(fromJson('["3.15"]'), matrix.python-version) }}
run: |
# pillow dependencies
sudo apt install libjpeg8-dev zlib1g-dev libtiff5-dev libwebp-dev libopenjp2-7-dev libavif-dev
pip install .[full]
pip list

- name: Check the completeness of MANIFEST.in
run: check-manifest .
- name: Run unit tests (with optional dependencies)
run: python -W error -bb test/test.py --unit --exit-early

- name: Run flake
run: flake8 --exclude=build,venv --ignore= --max-line-length=200 --max-complexity=75 --show-source --statistics .
- name: Run integration tests (internal, with optional dependencies)
run: |
ulimit -n
ulimit -n 4096
python -W error -bb test/test.py -i --exit-early

- name: Check distribution
- name: Run integration tests (external process, with optional dependencies)
run: |
ulimit -n
ulimit -n 4096
test/test.py -e --exit-early

- name: Install build dependencies
run: |
# Fallback hack required for pip < 25.1 (since newer pip is not available for Python < 3.9)
pip install --group build || pip install build
pip list

- name: Build
run: |
python -m build
twine check dist/*
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
2025-xx-xx - v3.2.1.dev0:
* WARNING: This is a development snapshot, not a stable release.
* Support for BLAKE3 b3sum format (Thanks to Artur Ladka).

2025-11-02 - v3.2.0:
* Drop support for Python 3.6.
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# cfv – Command-line File Verify

cfv is a utility to test and create a wide range of checksum verification files.
It currently supports testing and creating sfv, sfvmd5, csv, csv2, csv4, md5, bsdmd5, sha1, sha224,
sha256, sha384, sha512, torrent and crc files.
It currently supports testing and creating sfv, sfvmd5, csv, csv2, csv4, crc, md5, bsdmd5,
sha1, sha224, sha256, sha384, sha512, b3 (BLAKE3) and torrent files.
Test-only support is available for par, par2.

cfv was originally written by Matthew Mueller ([original project home](http://cfv.sourceforge.net/)).
Expand All @@ -25,6 +25,9 @@ For Python 2 support, see the [python2 branch](https://github.com/cfv-project/cf
* [Python Imaging Library (PIL)](https://www.pythonware.com/products/pil/) or
[Pillow](https://python-pillow.org/) – only needed if you want to create the
dimensions column of .crc files.
* [blake3](https://pypi.org/project/blake3/) – needed for BLAKE3 b3sum files (B3SUMS, .b3, .bk3).
Default output is 256 bits (32 bytes).
Install via `pip install blake3` or `apt install python3-blake3`.

## Install

Expand Down
35 changes: 22 additions & 13 deletions cfv.1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.TH cfv 1 "05 Feb 2005"
.SH NAME
cfv \- Verify file consistency with .sfv, .csv, .crc, .md5, md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, .torrent, par, or par2 files
cfv \- Verify file consistency with .sfv, .csv, .crc, .md5, md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, b3sum, .torrent, .par, or .par2 files
.SH SYNOPSIS
.B cfv [\-p dir] [\-v|\-V|\-VV|\-q|\-Q] [\-\-progress VAL] [\-r|\-rr|\-R] [\-l|\-L] [\-n|\-N] [\-\-renameformat <s>] [\-s|\-S] [\-zz|\-z|\-Z|\-ZZ] [\-T|\-C] [\-m|\-M] [\-i|\-I] [\-u|\-uu|\-U] [\-\-encoding <e>] [\-\-unquote <b>] [\-\-fixpaths <s>] [\-\-strippaths <p>] [\-\-showpaths <i>] [\-\-list/\-\-list0 <l>] [\-\-announceurl <u>] [\-\-piece_size_pow2 <n>] [\-\-private_torrent] [\-t type] [\-f file] [files...]
.B cfv [\-p dir] [\-v|\-V|\-VV|\-q|\-Q] [\-\-progress VAL] [\-r|\-rr|\-R] [\-l|\-L] [\-n|\-N] [\-\-renameformat <s>] [\-s|\-S] [\-zz|\-z|\-Z|\-ZZ] [\-T|\-C] [\-m|\-M] [\-i|\-I] [\-u|\-uu|\-U] [\-\-encoding <e>] [\-\-unquote <b>] [\-\-fixpaths <s>] [\-\-strippaths <p>] [\-\-showpaths <i>] [\-\-list/\-\-list0 <l>] [\-\-announceurl <u>] [\-\-piece_size_pow2 <n>] [\-\-private_torrent] [\-\-length <n>] [\-t type] [\-f file] [files...]
.SH DESCRIPTION
.B cfv
verifies that the files you have are the same as those that the were used to create
Expand Down Expand Up @@ -120,14 +120,18 @@ Specify the name of the checksum file to test or create.
If file is \-, stdin (for \-T) or stdout (for \-C) will be used.
.IP "\-t type"
Specify the type of the file.
Can be sfv, sfvmd5, csv, csv2, csv4, sha1, sha224, sha256, sha384, sha512, md5, bsdmd5, par, par2, torrent, crc, auto, or help.
Can be sfv, sfvmd5, csv, csv2, csv4, crc, md5, bsdmd5, sha1, sha224, sha256, sha384, sha512, b3, torrent, par, par2, auto, or help.
For details see supported checksum formats section.
If the type is help, or an unknown type is given, a list of the types and their descriptions will be printed.
The default is auto, which will detect the file type for you.
When creating, if type is auto an sfv will be made, unless a different default has been set in the config file.
.IP "\-\-list listset"
Prints a raw listing of files in the given set (ok, bad, unverified, notfound). Usually used with \-q, but not strictly needed since specifying \-\-list will redirect all other messages to stderr.
.IP "\-\-list0 listset"
Like \-\-list but files are separated by a null char. Useful in combination with xargs \-0.
.IP "\-\-length BITS"
Set digest length in bits for hash types that support variable output (b3).
The default for b3 is 256 bits. Must be a multiple of 8.
.IP "\-\-announceurl URL"
Tracker announce URL for .torrent file creation.
.IP "\-\-piece_size_pow2 N"
Expand All @@ -139,6 +143,8 @@ Set private flag in torrent during .torrent file creation.
Print help info.
.IP "\-\-version"
Print version of cfv and modules it uses.
.SH SUPPORTED CHECKSUM FILE FORMATS
The following types are supported:
.P
.B sfv
is a Simple File Verify format file
Expand All @@ -155,6 +161,15 @@ is a Comma Separated Value file, with the fields being name,size,
.B csv4
is a Comma Separated Value file, with the fields being name,size,crc32,path
.br
.B crc
is a JPEG Sheriff format crc file
.br
.B md5
is a GNU md5sum format file
.br
.B bsdmd5
is a BSD md5 format file
.br
.B sha1
is a GNU sha1sum format file
.br
Expand All @@ -170,23 +185,17 @@ is a GNU sha384sum format file
.B sha512
is a GNU sha512sum format file
.br
.B md5
is a GNU md5sum format file
.B b3
is a BLAKE3 b3sum format file (B3SUMS, .b3, .bk3). Requires the Python blake3 module.
.br
.B bsdmd5
is a BSD md5 format file
.B torrent
is a BitTorrent metainfo file
.br
.B par
is parchive v1 format file (test-only)
.br
.B par2
is parchive v2 format file (test-only)
.br
.B torrent
is a BitTorrent metainfo file
.br
.B crc
is a JPEG Sheriff format crc file
.SH EXIT STATUS
The exit status of cfv can be examined to determine what kind of errors, if any, occurred.
.P
Expand Down
Loading
Loading