github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/crypto/sha256.mdx (about) 1 --- 2 layout: docs 3 page_title: sha256 - Functions - Configuration Language 4 description: |- 5 The sha256 function computes the SHA256 hash of a given string and encodes it 6 with hexadecimal digits. 7 --- 8 9 # `sha256` Function 10 11 `sha256` computes the SHA256 hash of a given string and encodes it with 12 hexadecimal digits. 13 14 The given string is first encoded as UTF-8 and then the SHA256 algorithm is applied 15 as defined in [RFC 4634](https://tools.ietf.org/html/rfc4634). The raw hash is 16 then encoded to lowercase hexadecimal digits before returning. 17 18 ## Examples 19 20 ```shell-session 21 > sha256("hello world") 22 b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 23 ```