github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/website/docs/configuration/functions/sha512.html.md (about) 1 --- 2 layout: "functions" 3 page_title: "sha512 - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-crypto-sha512" 5 description: |- 6 The sha512 function computes the SHA512 hash of a given string and encodes it 7 with hexadecimal digits. 8 --- 9 10 # `sha512` Function 11 12 -> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and 13 earlier, see 14 [0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). 15 16 `sha512` computes the SHA512 hash of a given string and encodes it with 17 hexadecimal digits. 18 19 The given string is first encoded as UTF-8 and then the SHA512 algorithm is applied 20 as defined in [RFC 4634](https://tools.ietf.org/html/rfc4634). The raw hash is 21 then encoded to lowercase hexadecimal digits before returning. 22 23 ## Examples 24 25 ``` 26 > sha512("hello world") 27 309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f 28 ``` 29 30 ## Related Functions 31 32 * [`filesha512`](./filesha512.html) calculates the same hash from 33 the contents of a file rather than from a string value. 34 * [`base64sha512`](./base64sha512.html) calculates the same hash but returns 35 the result in a more-compact Base64 encoding.