summaryrefslogtreecommitdiff
path: root/shasum
diff options
context:
space:
mode:
Diffstat (limited to 'shasum')
-rwxr-xr-xshasum22
1 files changed, 22 insertions, 0 deletions
diff --git a/shasum b/shasum
new file mode 100755
index 0000000..18efefd
--- /dev/null
+++ b/shasum
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+for i in "$@"; do
+ case $i in
+ "-a") BITS="y"
+ continue
+ ;;
+ *)
+ ARGS="$i "
+ ;;
+ esac
+ if [ -n "$BITS" ]; then
+ case $i in
+ 256|512)
+ PROGRAM="sha"$i"sum"
+ ;;
+ esac
+ unset BITS
+ fi
+done
+cat - | "$PROGRAM" $ARGS
+echo "$PROGRAM $ARGS"