slitaz-base-files rev 121

httphelper: add sha512crypt function
author Christophe Lincoln <pankso@slitaz.org>
date Thu Apr 12 16:48:35 2012 +0200 (2012-04-12)
parents 7a11fde90d8a
children e22ca9050ae8
files rootfs/usr/lib/slitaz/httphelper
line diff
     1.1 --- a/rootfs/usr/lib/slitaz/httphelper	Thu Apr 12 16:44:11 2012 +0200
     1.2 +++ b/rootfs/usr/lib/slitaz/httphelper	Thu Apr 12 16:48:35 2012 +0200
     1.3 @@ -30,8 +30,10 @@
     1.4    urlencode string
     1.5    urldecode string
     1.6    htmlentities string
     1.7 -  md5crypt
     1.8 +  md5crypt string
     1.9 +  sha512crypt string
    1.10    httpinfo
    1.11 +  httphelper
    1.12  
    1.13  Example:
    1.14    header "Content-type: text/html" "Set-Cookie: name=value; HttpOnly"
    1.15 @@ -69,6 +71,11 @@
    1.16  	echo -n "$1" | md5sum | awk '{print $1}'
    1.17  }
    1.18  
    1.19 +# MD5 crypt a string. Stronger crypto than MD5
    1.20 +sha512crypt() {
    1.21 +	echo -n "$1" | sha512sum | awk '{print $1}'
    1.22 +}
    1.23 +
    1.24  _ARRAY()
    1.25  {
    1.26  [ -z "$2" ] && eval echo \$${1}__NAMES ||