[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RFE: 'multisum' - read file once, compute multiple checksums
From: |
Pádraig Brady |
Subject: |
RFE: 'multisum' - read file once, compute multiple checksums |
Date: |
Fri, 01 Nov 2013 14:27:40 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
From: https://bugzilla.redhat.com/1025675
-------- Original Message --------
Subject: [Bug 1025675] New: RFE: 'multisum' - read file once, compute multiple
checksums
Reporter: address@hidden
In some cases we want to compute multiple checksums at once.
CPU is frequently cheaper than IO and this would allow us to read each file
just once.
We're currently use cat | tee >(md5sum) >(sha256sum) etc., but that's not
exactly user-friendly and I'd like to replace it with a better tool.
Here's my proposal for 'multisum' behaviour:
Usage [add]
-s, --checksum checksum type
Note: Checksum type can be specified multiple times, but at least once.
If specified when verifying checksums, only checksums for given
checksum types will be verified.
File format
-----------
\?<checksum_type>:<checksum> [* ]<path>
records should be:
* grouped by path
* ordered by checksum type within one group
Example md5sum:
mkdir -p test-data; for i in "ab" "a b" 'a\b' "a\nb"; do echo "$i" >
"test-data/$i"; done; md5sum -b test-data/*
7557d2f3a6ad1a3a8ebd23a94ab0c642 *test-data/a b
daa8075d6ac5ff8d0c6d4650adb4ef29 *test-data/ab
\537c3478b5faa724bc71ed7fc1ac0f60 *test-data/a\\b
\ae2af30d93d6dbd7f6f62c775c038c60 *test-data/a\\nb
Multisum output would look like:
mkdir -p test-data; for i in "ab" "a b" 'a\b' "a\nb"; do echo "$i" >
"test-data/$i"; done; multisum -b -s sha256 -s md5 test-data/*
md5:7557d2f3a6ad1a3a8ebd23a94ab0c642 *test-data/a b
sha256:01186fcf04b4b447f393e552964c08c7b419c1ad7a25c342a0b631b1967d3a27
*test-data/a b
md5:daa8075d6ac5ff8d0c6d4650adb4ef29 *test-data/ab
sha256:a63d8014dba891345b30174df2b2a57efbb65b4f9f09b98f245d1b3192277ece
*test-data/ab
\md5:537c3478b5faa724bc71ed7fc1ac0f60 *test-data/a\\b
\sha256:eaba35b63f3a21c43bc4d579fa4ae0cd388ec8633c08e0a54859d07d33a0c487
*test-data/a\\b
\md5:ae2af30d93d6dbd7f6f62c775c038c60 *test-data/a\\nb
\sha256:d32170bf6e447af933ecabf6607a7e94b1fc35e01f71b618141aab849e00f45b
*test-data/a\\nb
You may also consider adding 'multisum' file format support to existing tools.
For instance md5sum -c being able to verify all records starting with 'md5:'
- RFE: 'multisum' - read file once, compute multiple checksums,
Pádraig Brady <=