Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cksum: --length 0 shouldn't fail for algorithms that don't support --length #9031

@RenjiSann

Description

@RenjiSann
$ ../gnu/src/cksum --version                                                                                              
cksum (GNU coreutils) 9.8.58-a2a2-modified
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Pádraig Brady and Q. Frank Xia.

# GNU
$ echo "test" | ../gnu/src/cksum -a md5 -l 128      
cksum: --length is only supported with --algorithm blake2b, sha2, or sha3
$ echo "test" | ../gnu/src/cksum -a md5 -l 0  
MD5 (-) = d8e8fca2dc0f896fd7cb4cb0031ba249

# ours
$ echo "test" | ./target/debug/cksum -a md5 -l 128
cksum: --length is only supported with --algorithm=blake2b
$ echo test | ./target/debug/cksum -a md5 -l 0
cksum: --length is only supported with --algorithm=blake2b

Note that GNU's error message mention sha2 and sha3, but that's another issue (see #8933)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions