The sha1 function provides an easy way to calculate the SHA1 hash of a given value.
Template function properties | |
---|---|
Function | Calculate the SHA1 hash of a given value |
Function name | sha1 |
Returns | The SHA1 hash |
Return type | string |
Can be used as a filter | Yes |
Can be used as a test | No |
Spook's influence | Newly added template function |
Developer tools | Try this in the template developer tools |
Signature |
---|
|
Function parameters | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
value | string | Yes | hash me |
ExamplesΒΆ
Using sha1 as a functionΒΆ
1
{{ sha1("hash me") }}
Returns:
3bd28babb1ea84fd20da6ff3abcc0791613d38d2
Using sha1 as a filterΒΆ
1
{{ "hash me" | sha1 }}
Returns:
3bd28babb1ea84fd20da6ff3abcc0791613d38d2
Features requests, ideas, and supportΒΆ
If you have an idea on how to further enhance the Home Assistant template engine, for example, by adding a new template function; feel free to let us know in our discussion forums.
Are you stuck using this new feature? Or maybe youβve run into a bug? Please check the Support page on where to go for help.