github.com/iaas-resource-provision/iaas-rpc@v1.0.7-0.20211021023331-ed21f798c408/website/docs/language/functions/sha512.html.md (about) 1 --- 2 layout: "language" 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 `sha512` computes the SHA512 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 SHA512 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 > sha512("hello world") 23 309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f 24 ``` 25 26 ## Related Functions 27 28 * [`filesha512`](./filesha512.html) calculates the same hash from 29 the contents of a file rather than from a string value. 30 * [`base64sha512`](./base64sha512.html) calculates the same hash but returns 31 the result in a more-compact Base64 encoding.