Comment

Comment by coldpie

It is a bit of effort, but you can make the computer do the verification for you by writing (or generating) a simple text file. Using Perl shasum because I'm on a mac at the moment, but Linux sha256sum works the same:

    $ echo hi > some_file
    $ shasum -a 256 some_file > check
    $ cat check
    98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4  some_file
    $ shasum -a 256 -c check
    some_file: OK
    $ echo $?
    0
    $ echo bye > some_file
    $ shasum -a 256 -c check
    some_file: FAILED
    shasum: WARNING: 1 computed checksum did NOT match
    $ echo $?
    1

Edit: Oh cool, at least perl's shasum allows reading from stdin so you can even skip the file if you're just copying some check file off the software's website:

    $ shasum -a 256 -c - <<EOF
    > 98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4  some_file
    > EOF
    some_file: OK
parent coldpie 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton