xxh*sum aren't Behaving Like sha*sum on Checking #724
Labels
No labels
announcement
bug
build
CI
dependencies
documentation
duplicate
enhancement
experience feedback
feature request
github_actions
help wanted
install
invalid
Long-term
optimization
portability
question
target-specific
test issue
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-Cyan4973/xxHash#724
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I.g. sha512sum will not check sha256sum's checksums, it'll output an error. xxHash checks all, not following Coreutils' behaviour.
Please would it be possible for "xxh64sum" to reject "xxh128sum" checksums and vice versa? For example, a symbolic link or the "-H" option modifies the behaviour, but "xxhsum" called alone behaves broadly like usual.
The step additionally might help with #645 in some way.
Hi ghost 👻 , thanks for the report.
I've confirmed your issue. Since they're long, I just put them in this post though.
Repro and details of the difference between sha*sum and xxh*sum
Clone & build
$ git clone https://github.com/Cyan4973/xxHash.git
$ cd xxHash/
$ make
Create sha256sum and sha512sum
$ sha256sum README.md > out.sha256sum
$ sha512sum README.md > out.sha512sum
$ cat out.sha256sum
936bb323f8a500ae6396858041c647a14f8d0230eafb3873cd8498537fab0c75 README.md
$ cat out.sha512sum
cd63147103fa14c82c04f925f197c7d3bbf5232529f952e9d450f469104014a1715185bcf1308f431f5f24172a5f7f97b8b0998e56fe2d93d0821c0db2107552 README.md
Test sha256sum
$ sha256sum -c out.sha256sum
README.md: OK
$ sha256sum -c out.sha512sum
sha256sum: out.sha512sum: no properly formatted SHA256 checksum lines found
Test sha512sum
$ sha512sum -c out.sha256sum
sha512sum: out.sha256sum: no properly formatted SHA512 checksum lines found
$ sha512sum -c out.sha512sum
README.md: OK
$ ./xxh64sum README.md > out.xxh64sum
$ ./xxh128sum README.md > out.xxh128sum
$ cat out.xxh64sum
bb03b8a8d9ac2202 README.md
$ cat out.xxh128sum
1c6c0b96b536a13f58b36ce50a91b1b9 README.md
$ ./xxh64sum -c out.xxh64sum
README.md: OK
$ ./xxh64sum -c out.xxh128sum
README.md: OK
$ ./xxh128sum -c out.xxh64sum
README.md: OK
$ ./xxh128sum -c out.xxh128sum
README.md: OK
How `digest.c` outputs the "no properly lines found" message.
I think there're some possible solutions.
(1) Mimic sshXXXsum (digest.c). When
xxhsumis invoked via symlink, it just accept specific length of hash value. (Breaking change)(2) Add new command line switch for more strict mode which mimics sshXXXsum.
--pretty-strict? (Compatible. But not compatible with sshXXXsum)A more restrictive acceptance policy for
xxh128sumand similar is likely appropriate.