I guess you want to output the string {{md5(sha1(base64Encoding({{someValue}})))}} which will be some md5 string. you calculate this in the view not the template directly. i.e.
"my_md5_var" -> md5(sha1(base64Encoding(someValue)))
"my_sha1_var" -> sha1(base64Encoding(someValue))
then use the result in the template:
{{my_md5_var}} <br/>
{{my_sha1_var}} <br/>
The point been to use the template only to display your result how you please(html etc). Operating aspect of the variable should remain in the language (Java etc).