Created
January 9, 2017 19:03
-
-
Save xiconet/34b410d925b092f3b9ea260877392d28 to your computer and use it in GitHub Desktop.
Revisions
-
steakknife revised this gist
Mar 4, 2016 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ md5() { # python -sBc "import hashlib;print hashlib.md5(open('$1','rb').read()).hexdigest()" # md5 "$1"|cut -d' ' -f4 # mac # md5sum "$1"|cut -d' ' -f1 # linux # openssl md5 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat } @@ -17,7 +17,7 @@ sha1() { # python -sBc "import hashlib;print hashlib.sha1(open('$1','rb').read()).hexdigest()" # shasum "$1"|cut -d' ' -f1 # mac # sha1sum "$1"|cut -d' ' -f1 # linux # openssl sha1 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat } @@ -27,7 +27,7 @@ sha224() { # python -sBc "import hashlib;print hashlib.sha224(open('$1','rb').read()).hexdigest()" # shasum -a224 "$1"|cut -d' ' -f1 # mac # sha224sum "$1"|cut -d' ' -f1 # linux # openssl dgst -sha224 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat } @@ -37,7 +37,7 @@ sha256() { # python -sBc "import hashlib;print hashlib.sha256(open('$1','rb').read()).hexdigest()" # shasum -a256 "$1"|cut -d' ' -f1 # mac # sha256sum "$1"|cut -d' ' -f1 # linux # openssl dgst -sha256 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat } @@ -47,7 +47,7 @@ sha384() { # python -sBc "import hashlib;print hashlib.sha384(open('$1','rb').read()).hexdigest()" # shasum -a384 "$1"|cut -d' ' -f1 # mac # sha384sum "$1"|cut -d' ' -f1 # linux # openssl dgst -sha384 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat } @@ -57,5 +57,5 @@ sha512() { # python -sBc "import hashlib;print hashlib.sha512(open('$1','rb').read()).hexdigest()" # shasum -a512 "$1"|cut -d' ' -f1 # mac # sha512sum "$1"|cut -d' ' -f1 # linux # openssl dgst -sha512 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat } -
steakknife revised this gist
Mar 4, 2016 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ md5() { # python -sBc "import hashlib;print hashlib.md5(open('$1','rb').read()).hexdigest()" # md5 "$1"|cut -d' ' -f4 # mac # md5sum "$1"|cut -d' ' -f1 # linux # openssl md5 "$1" | sed 's/MD5(.*)= //' } @@ -16,6 +17,7 @@ sha1() { # python -sBc "import hashlib;print hashlib.sha1(open('$1','rb').read()).hexdigest()" # shasum "$1"|cut -d' ' -f1 # mac # sha1sum "$1"|cut -d' ' -f1 # linux # openssl sha1 "$1" | sed 's/SHA1(.*)= //' } @@ -25,6 +27,7 @@ sha224() { # python -sBc "import hashlib;print hashlib.sha224(open('$1','rb').read()).hexdigest()" # shasum -a224 "$1"|cut -d' ' -f1 # mac # sha224sum "$1"|cut -d' ' -f1 # linux # openssl dgst -sha224 "$1" | sed 's/SHA224(.*)= //' } @@ -34,6 +37,7 @@ sha256() { # python -sBc "import hashlib;print hashlib.sha256(open('$1','rb').read()).hexdigest()" # shasum -a256 "$1"|cut -d' ' -f1 # mac # sha256sum "$1"|cut -d' ' -f1 # linux # openssl dgst -sha256 "$1" | sed 's/SHA256(.*)= //' } @@ -43,6 +47,7 @@ sha384() { # python -sBc "import hashlib;print hashlib.sha384(open('$1','rb').read()).hexdigest()" # shasum -a384 "$1"|cut -d' ' -f1 # mac # sha384sum "$1"|cut -d' ' -f1 # linux # openssl dgst -sha384 "$1" | sed 's/SHA384(.*)= //' } @@ -52,4 +57,5 @@ sha512() { # python -sBc "import hashlib;print hashlib.sha512(open('$1','rb').read()).hexdigest()" # shasum -a512 "$1"|cut -d' ' -f1 # mac # sha512sum "$1"|cut -d' ' -f1 # linux # openssl dgst -sha512 "$1" | sed 's/SHA512(.*)= //' } -
steakknife revised this gist
Jan 14, 2015 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ md5() { perl -MDigest::MD5=md5_hex -le'print md5_hex(<> or die)' "$1" # ruby -rdigest/md5 -e"puts Digest::MD5.file'/dev/null'" # python -sBc "import hashlib;print hashlib.md5(open('$1','rb').read()).hexdigest()" # md5 "$1"|cut -d' ' -f4 # mac # md5sum "$1"|cut -d' ' -f1 # linux } @@ -14,7 +14,7 @@ sha1() { perl -MDigest::SHA=sha1_hex -Xle'print sha1_hex(<> or die)' "$1" # ruby -rdigest/sha1 -e"puts Digest::SHA1.file'$1'" # python -sBc "import hashlib;print hashlib.sha1(open('$1','rb').read()).hexdigest()" # shasum "$1"|cut -d' ' -f1 # mac # sha1sum "$1"|cut -d' ' -f1 # linux } @@ -23,7 +23,7 @@ sha224() { perl -MDigest::SHA=sha224_hex -le'print sha224_hex(<>or die)' "$1" # ruby -rdigest/sha2 -e"puts Digest::SHA224.file'$1'" # python -sBc "import hashlib;print hashlib.sha224(open('$1','rb').read()).hexdigest()" # shasum -a224 "$1"|cut -d' ' -f1 # mac # sha224sum "$1"|cut -d' ' -f1 # linux } @@ -32,7 +32,7 @@ sha256() { perl -MDigest::SHA=sha256_hex -le'print sha256_hex(<>or die)' "$1" # ruby -rdigest/sha2 -e"puts Digest::SHA256.file'$1'" # python -sBc "import hashlib;print hashlib.sha256(open('$1','rb').read()).hexdigest()" # shasum -a256 "$1"|cut -d' ' -f1 # mac # sha256sum "$1"|cut -d' ' -f1 # linux } @@ -41,7 +41,7 @@ sha384() { perl -MDigest::SHA=sha384_hex -le'print sha384_hex(<>or die)' "$1" # ruby -rdigest/sha2 -e"puts Digest::SHA384.file'$1'" # python -sBc "import hashlib;print hashlib.sha384(open('$1','rb').read()).hexdigest()" # shasum -a384 "$1"|cut -d' ' -f1 # mac # sha384sum "$1"|cut -d' ' -f1 # linux } @@ -50,6 +50,6 @@ sha512() { perl -MDigest::SHA=sha512_hex -le'print sha512_hex(<>or die)' "$1" # ruby -rdigest/sha2 -e"puts Digest::SHA512.file'$1'" # python -sBc "import hashlib;print hashlib.sha512(open('$1','rb').read()).hexdigest()" # shasum -a512 "$1"|cut -d' ' -f1 # mac # sha512sum "$1"|cut -d' ' -f1 # linux } -
Barry Allard revised this gist
Apr 2, 2012 . 2 changed files with 55 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ # bourne shell functions below take 1 argument, the file_to_hash. # prints hex digest on stdout md5() { perl -MDigest::MD5=md5_hex -le'print md5_hex(<> or die)' "$1" # ruby -rdigest/md5 -e"puts Digest::MD5.file'/dev/null'" # python -sBc "import hashlib;print hashlib.md5(open('$1','rb').read()).hexdigest()" # md5 "$1"|cut -d' ' -f4 # mac/bsd # md5sum "$1"|cut -d' ' -f1 # linux } sha1() { perl -MDigest::SHA=sha1_hex -Xle'print sha1_hex(<> or die)' "$1" # ruby -rdigest/sha1 -e"puts Digest::SHA1.file'$1'" # python -sBc "import hashlib;print hashlib.sha1(open('$1','rb').read()).hexdigest()" # shasum "$1"|cut -d' ' -f1 # mac/bsd # sha1sum "$1"|cut -d' ' -f1 # linux } sha224() { perl -MDigest::SHA=sha224_hex -le'print sha224_hex(<>or die)' "$1" # ruby -rdigest/sha2 -e"puts Digest::SHA224.file'$1'" # python -sBc "import hashlib;print hashlib.sha224(open('$1','rb').read()).hexdigest()" # shasum -a224 "$1"|cut -d' ' -f1 # mac/bsd # sha224sum "$1"|cut -d' ' -f1 # linux } sha256() { perl -MDigest::SHA=sha256_hex -le'print sha256_hex(<>or die)' "$1" # ruby -rdigest/sha2 -e"puts Digest::SHA256.file'$1'" # python -sBc "import hashlib;print hashlib.sha256(open('$1','rb').read()).hexdigest()" # shasum -a256 "$1"|cut -d' ' -f1 # mac/bsd # sha256sum "$1"|cut -d' ' -f1 # linux } sha384() { perl -MDigest::SHA=sha384_hex -le'print sha384_hex(<>or die)' "$1" # ruby -rdigest/sha2 -e"puts Digest::SHA384.file'$1'" # python -sBc "import hashlib;print hashlib.sha384(open('$1','rb').read()).hexdigest()" # shasum -a384 "$1"|cut -d' ' -f1 # mac/bsd # sha384sum "$1"|cut -d' ' -f1 # linux } sha512() { perl -MDigest::SHA=sha512_hex -le'print sha512_hex(<>or die)' "$1" # ruby -rdigest/sha2 -e"puts Digest::SHA512.file'$1'" # python -sBc "import hashlib;print hashlib.sha512(open('$1','rb').read()).hexdigest()" # shasum -a512 "$1"|cut -d' ' -f1 # mac/bsd # sha512sum "$1"|cut -d' ' -f1 # linux } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +0,0 @@ -
Barry Allard revised this gist
Feb 12, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ python -sBc "import hashlib;print hashlib.sha1(open('$1', 'rb').read()).hexdigest()" ruby -rdigest/sha1 -e"puts Digest::SHA1.file'$1'" perl -MDigest::SHA=sha1_hex -le 'print sha1_hex<>' "$1" -
Barry Allard renamed this gist
Feb 12, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ perl -MDigest::SHA=sha1_hex -le 'print sha1_hex<>' "$1" python -sBc "import hashlib;print hashlib.sha1(open('$1', 'rb').read()).hexdigest()" ruby -rdigest/sha1 -e"puts Digest::SHA1.file'$1'" -
Barry Allard created this gist
Feb 12, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ perl -MDigest::SHA=sha1_hex -le 'print sha1_hex<>' "$1" python -sBc "import hashlib;print hashlib.sha1(open('$1', 'rb').read()).hexdigest()"