]> gitweb.pimeys.fr Git - scripts-20-100.git/blob - hashmdp.sh
typo
[scripts-20-100.git] / hashmdp.sh
1 #!/bin/bash
2
3 # Script pour hasher en md5 une chaîne de caractères grâce à python
4
5 if [ ! $1 ]
6 then
7 echo "Usage : hashmdp [-sha] une_chaine"
8 exit 1
9 else
10 if [ "$1" = "-sha" ]
11 then
12 python -c "import hashlib;print hashlib.sha256('$2').hexdigest()"
13 else
14 python -c "import hashlib;print hashlib.md5('$1').hexdigest()"
15 fi
16 fi