3.141.202.187 |    

Navigation

Google Advertisement

Die Funktion md5() ist der gleichnamigen PHP Funktion nach empfunden. Die Funktion codiert einen String in ein md5 Hash in einer Länge von 32 Zeichen. Mit dem zweiten Parameter kann man die Länge des md5 Hashes kürzen

md5
  1. # ***************************************************************************
  2. # This function encode a sting in md5 hash of 32 characters. You can short
  3. # the length with the second parameter.
  4. #
  5. #  @param string $1 string (required)
  6. #  @param integer $2 length (option, default: 32)
  7. #  @return string
  8. #  @example:    md5 "Hello World" 8
  9.  
  10. function md5() {
  11.  
  12. local length=${2:-32}
  13. local string=$( echo "$1" | md5sum | awk '{ print $1 }' )
  14. echo ${string:0:${length}}
  15.  
  16. }
Parsed in 0.002 seconds at 303.97 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 1 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)