github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/sha256.mdx (about) 1 --- 2 page_title: sha256 - Functions - Configuration Language 3 description: |- 4 The sha256 function computes the SHA256 hash of a given string and encodes it 5 with hexadecimal digits. 6 --- 7 8 # `sha256` Function 9 10 `sha256` computes the SHA256 hash of a given string and encodes it with 11 hexadecimal digits. 12 13 The given string is first encoded as UTF-8 and then the SHA256 algorithm is applied 14 as defined in [RFC 4634](https://tools.ietf.org/html/rfc4634). The raw hash is 15 then encoded to lowercase hexadecimal digits before returning. 16 17 ## Examples 18 19 ``` 20 > sha256("hello world") 21 b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 22 ``` 23 24 ## Related Functions 25 26 ## Related Functions 27 28 * [`filesha256`](/language/functions/filesha256) calculates the same hash from 29 the contents of a file rather than from a string value. 30 * [`base64sha256`](/language/functions/base64sha256) calculates the same hash but returns 31 the result in a more-compact Base64 encoding.