slitaz-base-files rev 114 4.5

httphelper: add md5crypt function
author Christophe Lincoln <pankso@slitaz.org>
date Thu Apr 05 13:51:01 2012 +0200 (2012-04-05)
parents 00bd4a793041
children ea385c65d1de
files rootfs/usr/lib/slitaz/httphelper
line diff
     1.1 --- a/rootfs/usr/lib/slitaz/httphelper	Thu Mar 29 15:32:19 2012 +0200
     1.2 +++ b/rootfs/usr/lib/slitaz/httphelper	Thu Apr 05 13:51:01 2012 +0200
     1.3 @@ -30,6 +30,7 @@
     1.4    urlencode string
     1.5    urldecode string
     1.6    htmlentities string
     1.7 +  md5crypt
     1.8    httpinfo
     1.9  
    1.10  Example:
    1.11 @@ -63,6 +64,11 @@
    1.12  	echo $1 | sed 's|&|\&amp;|g;s|<|\&lt;|g;s|>|\&gt;|g;s|"|\&quot;|g'
    1.13  }
    1.14  
    1.15 +# MD5 crypt a string such as password (httpd -m dont give same result ?)
    1.16 +md5crypt() {
    1.17 +	echo -n "$1" | md5sum | awk '{print $1}'
    1.18 +}
    1.19 +
    1.20  _ARRAY()
    1.21  {
    1.22  [ -z "$2" ] && eval echo \$${1}__NAMES ||