[Top][All Lists]

[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


-------- Original Message --------
Subject: [Bug 1025675] New: RFE: 'multisum' - read file once, compute multiple 
          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
*test-data/a b
md5:daa8075d6ac5ff8d0c6d4650adb4ef29 *test-data/ab
\md5:537c3478b5faa724bc71ed7fc1ac0f60 *test-data/a\\b
\md5:ae2af30d93d6dbd7f6f62c775c038c60 *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:'

reply via email to

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