# Hash of variable (rather than hash of file)?

**URL:** <https://zola.discourse.group/t/hash-of-variable-rather-than-hash-of-file/1168>\
**Category:** Feature requests\
**Created:** [February 3, 2022, 5:57pm UTC](https://zola.discourse.group/t/hash-of-variable-rather-than-hash-of-file/1168 "2022-02-03T17:57:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![justyn](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@justyn](https://zola.discourse.group/u/justyn)\
**Post date:** [February 3, 2022, 5:57pm UTC](https://zola.discourse.group/t/hash-of-variable-rather-than-hash-of-file/1168/1 "2022-02-03T17:57:40Z")

</div>

I’d like to get the hash of a variable in a template/theme.

It is already possible to get the hash of a file using [get\_file\_hash](https://www.getzola.org/documentation/templates/overview/#get-file-hash).

Is there already a way get the same but for a string variable?

If not, would a PR be accepted providing the functionality? I imagine something that would take identical arguments to the `get_file_hash` function.

I’m suggesting something like this:

```auto
{{ some_text | hash(sha_type=256) }}

```

Of course this wouldn’t have any extra dependencies because hashing functionality is already present.

All comments/insights appreciated!

Thanks
