Add md5 and sha1 template funcs

This commit is contained in:
digitalcraftsman 2016-03-07 21:40:47 +01:00 committed by Bjørn Erik Pedersen
parent e101a2dc7a
commit 6cc6c818f7

View File

@ -595,6 +595,33 @@ CJK-like languages.
```
### md5
`md5` hashes the given input and returns its MD5 checksum.
```html
{{ md5 "Hello world, gophers!" }}
<!-- returns the string "b3029f756f98f79e7f1b7f1d1f0dd53b" -->
```
This can be useful if you want to use Gravatar for generating a unique avatar:
```html
<img src="https://www.gravatar.com/avatar/{{ md5 "your@email.com" }}?s=100&d=identicon">
```
### sha1
`sha1` hashes the given input and returns its SHA1 checksum.
```html
{{ sha1 "Hello world, gophers!" }}
<!-- returns the string "c8b5b0e33d408246e30f53e32b8f7627a7a649d4" -->
```
## URLs
### absURL, relURL