md5. MD5 hash of a string


^math:md5[string]

The method gets 16-byte hash of specified
string and outputs it as a string-bytes are output in hexadecimal code without delimiters, lowercase.

It is believed that:
·it is practically impossible for two strings to have the same MD5-hash;  
·it is practically impossible to restore original string from its MD5-hash.  

Example
As a name of cache-file we will use an MD5-hash of $request:uri, It will not only provide univocal match of filename and request string, but also deliver us from necessity of shortening request string and removing special characters from it.

^
cache[$cache_directory/^math:md5[$request:uri]]($cache_time){
    …
}


Detailed information on MD5 is available at http://www.ietf.org/rfc/rfc1321.txt



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 20.09.2007