Skip to content

Commit

Permalink
add documentation section for get_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
n-tux-tmp authored Aug 13, 2022
1 parent 4f449e2 commit e800287
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/content/documentation/templates/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,19 @@ integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Int

Do note that subresource integrity is typically used when using external scripts, which `get_file_hash` does not support.

### `get_hash`

Returns the hash digest (SHA-256, SHA-384 or SHA-512) of a string literal.

It can take the following arguments:
- `literal`: mandatory, the value to be hashed
- `sha_type`: optional, one of `256`, `384` or `512`, defaults to `384`
- `base64`: optional, `true` or `false`, defaults to `true`. Whether to encode the hash as base64

```jinja2
{{/* get_hash(literal="Hello World", sha_type=256) */}}
```

### `get_image_metadata`

Gets metadata for an image. This supports common formats like JPEG, PNG, WebP, BMP, GIF as well as SVG.
Expand Down

0 comments on commit e800287

Please sign in to comment.