aboutsummaryrefslogtreecommitdiff
path: root/b3sum/src
AgeCommit message (Collapse)Author
2024-07-03Switch to rayon-core for faster buildsilvanshade
2023-09-16replace the new file module with inherent methods on HasherJack O'Connor
New methods: - update_reader - update_mmap - update_mmap_rayon These are more discoverable, more convenient, and safer. There are two problems I want to avoid by taking a `Path` instead of a `File`. First, exposing `Mmap` objects to the caller is fundamentally unsafe, and making `maybe_mmap_file` private avoids that issue. Second, taking a `File` raises questions about whether memory mapped reads should behave like regular file reads. (Should they respect the current seek position? Should they update the seek position?) Taking a `Path` from the caller and opening the `File` internally avoids these questions.
2023-09-16move file operations from b3sum to blake3Banyc
2023-06-06add b3sum --seekJack O'Connor
2023-03-25upgrade all Cargo.toml files to edition=2021Jack O'Connor
The MSRV is already 1.60, so this doesn't affect much. The only impact to other code is that we no longer need to explicitly import TryInto.
2023-02-04do another saturating_add for consistencyJack O'Connor
This one is less security/correctness-critical than the other one I just added, but I might as well be consistent.
2023-02-04add a colon to the b3sum warning formatJack O'Connor
This matches what md5sum does.
2023-02-04do a saturating_add for files_failedJack O'Connor
2023-02-04Use u64 instead of i64joveian
2023-02-04Add --check summary of failuresjoveian
Add a warning to stderr at the end similar to other *sum utilities when --check is used and some files failed verification. At least the last part of the comment above check_one_checkfile seemed to be incorrect so I removed that comment. Fixes #283
2022-12-13test `b3sum --keyed` with bad key lengthsJack O'Connor
2022-12-13expand the short description of b3sum --keyedJack O'Connor
2022-11-20grammar fix in b3sum help outputJack O'Connor
2022-11-20clean up b3sum help strings and increase max_term_width to 100Jack O'Connor
2022-10-03Split short summary from full help textShun Sakai
2022-10-03Bump clap to v4.0Shun Sakai
2022-09-14Rewrite CLI using Derive APIShun Sakai
2022-03-27fix a deprecation warning from clapJack O'Connor
2022-03-26RUSTSEC-2020-0077Zach Crownover
Migrate from the abandoned memmap library to the now maintained fork of memmap2
2022-01-07update clap to v3Jack O'Connor
2021-03-28more cleaup of undocumented APIJack O'Connor
2021-03-14add *_rayon methodsJack O'Connor
2020-06-24put the file name in b3sum error outputJack O'Connor
This was previously there, but got dropped in c5c07bb337d0af7522666d05308aaf24eef3709c.
2020-05-25all-capitalize "FILE" in the b3sum help outputJack O'Connor
2020-05-25avoid repeating a stringJack O'Connor
2020-05-23remove an extra space in some help textJack O'Connor
2020-05-23use wild::args_os to support globbing on WindowsJack O'Connor
2020-05-23add support for --quiet to `b3sum --check`Jack O'Connor
Suggested by @llowrey: https://github.com/BLAKE3-team/BLAKE3/issues/33#issuecomment-629853747
2020-05-14clarify that --no-mmap disables threadingJack O'Connor
2020-05-14print per-file errros more gracefuly in --checkJack O'Connor
2020-05-13refactor b3sum to support --checkJack O'Connor
This is an overall cleanup of everything that b3sum is doing, especially file opening and memory mapping, which makes it easier for the regular hashing mode to share code with the checking mode.
2020-05-12add parse_check_lineJack O'Connor
As part of this, reorganize b3sum tests into src/unit_tests.rs and tests/cli_tests.rs.
2020-05-12stop printing the lossy warningJack O'Connor
Rather than breaking the check parse with more output, we'll have a rule that a Unicode replacement character (�) in a path name automatically fails the check.
2020-05-05add newline and backslash escaping to b3sum outputJack O'Connor
As proposed in https://github.com/BLAKE3-team/BLAKE3/issues/33#issuecomment-623153164 This brings b3sum behavior close to md5sum. All occurrences of backslash are replaced with "\\", and all occurrences of (Unix) newline are replaced with "\n". In addition, any line containing these escapes has a single "\" prepended to the front. Filepaths were already being converted to UTF-8 with to_string_lossy(), but this commit adds an extra warning when that conversion is in fact lossy (because the path is not valid Unicode). This new warning is printed to stdout, with the goal of deliberately breaking --check (which is not yet implemented) in this case.
2020-03-16add the --num-threads flagJack O'Connor
As part of this change, make the rayon and memmap dependencies mandatory. This simplifies the code a lot, and I'm not aware of any callers who build b3sum without the default dependencies. If --num-threads is not given, or if its value is 0, b3sum will still respect the RAYON_NUM_THREADS environment variable.
2020-03-15wrap --help output to 80 columnsJack O'Connor
2020-02-06Hasher::update_with_joinJack O'Connor
This is a new interface that allows the caller to provide a multi-threading implementation. It's defined in terms of a new `Join` trait, for which we provide two implementations, `SerialJoin` and `RayonJoin`. This lets the caller control when multi-threading is used, rather than the previous all-or-nothing design of the "rayon" feature. Although existing callers should keep working, this is a compatibility break, because callers who were relying on automatic multi-threading before will now be single-threaded. Thus the next release of this crate will need to be version 0.2. See https://github.com/BLAKE3-team/BLAKE3/issues/25 and https://github.com/BLAKE3-team/BLAKE3/issues/54.
2020-01-20clarify the --no-mmap logic a bitJack O'Connor
2020-01-20b3sum: add no-mmap optionCesar Eduardo Barros
Using mmap is not always the best option. For instance, if the file is truncated while being read, b3sum will receive a SIGBUS and abort. Follow ripgrep's lead and add a --no-mmap option to disable mmap. This can also help benchmark the mmap versus the read path, and help debug performance issues potentially caused by mmap access patterns (like issue #32).
2020-01-17edit the --raw help stringJack O'Connor
2020-01-17Merge pull request #22 from phayes/raw_outputJack O'Connor
Adds support for raw output to b3sum
2020-01-17b3sum: do not mmap files smaller than 16 KiBAlbert Safin
2020-01-14Using take() to limit the number of bytes copiesphayes
2020-01-13bailing early if we have both --raw and multiple filesphayes
2020-01-13Fixing stdout lockingphayes
2020-01-13Locking stdout for writing in a tight loop.phayes
2020-01-13Adds support for raw output to b3sumphayes
2020-01-07clarify that b3sum --keyed takes raw key bytesJack O'Connor
2020-01-05make the --length argument require a valueJack O'Connor
2019-12-28make derive_key take a key of any lengthJack O'Connor
The previous version of this API called for a key of exactly 256 bits. That's good for optimal performance, but it would mean losing the use-with-other-algorithms property for applications whose input keys are a different size. There's no way for an abstraction over the previous version to provide reliable domain separation for the "extract" step.