github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/sha1.mdx (about) 1 --- 2 page_title: sha1 - Functions - Configuration Language 3 description: |- 4 The sha1 function computes the SHA1 hash of a given string and encodes it 5 with hexadecimal digits. 6 --- 7 8 # `sha1` Function 9 10 `sha1` computes the SHA1 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 SHA1 algorithm is applied 14 as defined in [RFC 3174](https://tools.ietf.org/html/rfc3174). The raw hash is 15 then encoded to lowercase hexadecimal digits before returning. 16 17 Collision attacks have been successfully performed against this hashing 18 function. Before using this function for anything security-sensitive, review 19 relevant literature to understand the security implications. 20 21 ## Examples 22 23 ``` 24 > sha1("hello world") 25 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed 26 ``` 27 28 ## Related Functions 29 30 * [`filesha1`](/language/functions/filesha1) calculates the same hash from 31 the contents of a file rather than from a string value.