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

Re: Checksumming tool



Lars Wirzenius wrote:
>         
> The best I've come up with so far is a pseudo rfc822 syntax:
> 
>         File: foo%20bar/hellurei.txt
>         Size: 12345
>         MD5: 012345667
>         SHA-256: 0a0a0a0a0a0a0a0a0a0a0a0a
>         Mode: 0644

anthony@feynman:tmp$ md5sum test
04c09e317db0addf12be8d1a4e2b9e37  test

anthony@feynman:tmp$ sha1sum test
35a980f320a5f72b11f3616c476fab2844118879  test


That format is extremely easy to work with using basic Unix commands
like grep, cut, sort, diff, etc. The one you've come up with is not.

Please, keep the useful one record (file) per line format. Is there
something wrong with:

LINE = TAG DELIM1 HASH DELIM2 FILENAME
DELIM1 = " " | "-" | ":" | ... (pick one)
DELIM2 = " "

If you let DELIM1 be either "-" or ":" and DELIM2 be " " then you are
backwards compatible with both md5sum and sha1sum by making 32-character
untagged hashes mean MD5 and 40-character ones mean SHA-1.

    sha-256:<<blah,blah,blah>> test

is so much easier to deal with than rfc822 stuff.



Reply to: