bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Don't you think there are too many *sum utilities?


From: Eric Blake
Subject: Re: Don't you think there are too many *sum utilities?
Date: Mon, 09 Apr 2007 06:28:38 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Alfred M. Szmidt on 4/9/2007 6:17 AM:
>    > I don't see any major problem why something like `hashsum
>    > ALGORITHM' wouldn't work though, `md5sum' could be the same as
>    > `hashsum md5'.  And then md5sum could be a shell script, or just
>    > a simple program that calls `hashsum md5'.
> 
>    Except that since the *sum utilities operate on arbitrary files,
>    you would need it to be `hashsum --md5', ie. make the algorithm an
>    option rather than the first argument.
> 
> Why not just: hashsum ALGORITHM [FILE]? A optional hashing algorithm
> seems pointless for this.

Because on decoding, 'hashsum -c FILE' could be made smart enough to
auto-detect the algorithm based on the length of the hash, but only if the
algorithm is optional (--md5) rather than required (md5).  Currently, md5,
sha1, sha224, sha256, sha384, and sha512 all produce different hash
lengths, making this task unambiguous (but I'm not sure how long md4 is).

At any rate, since cksum is specified by POSIX, and since sum has a
different output format, it is much harder to combine those two into a
proposed hashsum than it is to join md5 and sha* sums.

And as long as the complaint is about the number of separately named
utilities, note that this page
http://www.mkssoftware.com/docs/man1/dgstsum.1.asp also lists dgstsum,
md2sum, mdc2sum, shasum, and ripemd160sum as separate utilities.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGGjF184KuGfSFAYARAvLeAJ4tv3Rl+tS8faZLL3OVRopctBQWcQCfc4vh
lX2NvDuS/HS6sM7BqL1Qhbs=
=wmyl
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]