[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Wish: checksumming *sum filter
From: |
Pádraig Brady |
Subject: |
RE: Wish: checksumming *sum filter |
Date: |
Fri, 10 May 2019 05:15:30 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
Ole Tange wrote:
> Hi
>
> I have a couple of time wanted a checksumming filter,
> that will work like cat if the input matches the checksum
> and output nothing if it does not:
>
> Get_untrusted_input |
> sha256sum bf794518e35d7f1ce3a50b3058c4191bb9401e568fc645d77e10b0f404cf1f22 |
> do something on the stream I now know matches the sum.
>
> Could we extend the *sum programs to support that?
The fact that *sum would need to consume/buffer all the input
would mean that the parallelism from the rest of the pipe is lost
(well I suppose the process startup overhead is parallelized).
I.E. it's functionally equivalent to:
Get_untrused_input > /tmp/blah
sha256sum -c <(echo "$chksum /tmp/blah") &&
...
rm /tmp/blah
I'm not sure generated input is a common enough usecase
to support that directly within sha256sum
cheers,
Pádraig
- RE: Wish: checksumming *sum filter,
Pádraig Brady <=