Files
immortalwrt/scripts
Paul Spooren d5c27b31ff scripts: mkhash fail on hashing a folder
mkhash currently returns the hash of an empty input when trying to hash
a folder. This can be missleading in caseswhere e.g. an env variable is
undefined which should contain a filename. `mkhash ./path/to/$FILE`
would exit with code 0 and return a legit looking checksum.

A better behaviour would be to fail with exit code 1, which imitates the
behaviour of `md5sum` and `sha256sum`.

To avoid hashing of folders the `stat()` is checked.

Hashing empty inputs result in the following checksums:
md5: d41d8cd98f00b204e9800998ecf8427e
sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-12 11:10:10 +08:00
..
2020-07-08 12:02:08 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2018-01-15 18:26:41 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2020-02-21 02:41:00 +08:00
2018-09-07 13:43:55 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2020-02-21 02:41:00 +08:00
2017-09-06 19:19:45 +08:00
2017-09-06 19:19:45 +08:00
2020-02-21 02:41:00 +08:00
2018-09-07 13:43:55 +08:00
2017-09-06 19:19:45 +08:00
2020-02-21 02:41:00 +08:00
2017-09-06 19:19:45 +08:00