summaryrefslogtreecommitdiff
path: root/ffmpeg/tests/md5.sh
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-09-05 17:57:22 +0100
committerTim Redfern <tim@eclectronics.org>2013-09-05 17:57:22 +0100
commit8992cb1d0d07edc33d274f6d7924ecdf6f83d994 (patch)
tree3a2c86846b7eec8137c1507e623fc7018f13d453 /ffmpeg/tests/md5.sh
parent741fb4b9e135cfb161a749db88713229038577bb (diff)
making act segmenter
Diffstat (limited to 'ffmpeg/tests/md5.sh')
-rw-r--r--ffmpeg/tests/md5.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/ffmpeg/tests/md5.sh b/ffmpeg/tests/md5.sh
new file mode 100644
index 0000000..5e2528c
--- /dev/null
+++ b/ffmpeg/tests/md5.sh
@@ -0,0 +1,13 @@
+# try to find an md5 program
+
+if [ X"$(echo | md5sum -b 2> /dev/null)" != X ]; then
+ do_md5sum() { md5sum -b $1; }
+elif [ X"$(echo | command md5 2> /dev/null)" != X ]; then
+ do_md5sum() { command md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; }
+elif [ -x /sbin/md5 ]; then
+ do_md5sum() { /sbin/md5 -r $1 | sed 's/\([0-9a-f]\) [ *]*/\1 */'; }
+elif openssl version >/dev/null 2>&1; then
+ do_md5sum() { openssl md5 $1 | sed 's/MD5(\(.*\))= \(.*\)/\2 *\1/'; }
+else
+ do_md5sum() { echo No md5sum program found; }
+fi