Implementation of sha256sum using POSIX utilities.

Eric Bavier f07db6b50d sha256sum: precompute powers of 2. 3 éve
.gitignore 6c6d5ad70f Initial commit. 4 éve
README.md 96ab71c997 sha256sum: Accept multiple filename arguments. 4 éve
bench-bc.sh 6c6d5ad70f Initial commit. 4 éve
sha256sum.sh f07db6b50d sha256sum: precompute powers of 2. 3 éve

README.md

SHA256SUM

This is a terrible, yet functional and correct, implementation of sha256sum using POSIX shell and utilities. I wrote it out of curiosity, and to learn a little more about what existing utilities are capable of.

It is incredibly slow, needing about 4 seconds per KiB on my system.

$ echo "foo" >/tmp/foo; echo "bar" >/tmp/bar
$ ./sha256sum.sh /tmp/foo /tmp/bar
b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c  /tmp/foo
5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03  /tmp/bar
$ sha256sum /tmp/foo /tmp/bar
b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c  /tmp/foo
5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03  /tmp/bar