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