github.com/jaredpalmer/terraform@v1.1.0-alpha20210908.0.20210911170307-88705c943a03/website/docs/language/functions/md5.html.md (about) 1 --- 2 layout: "language" 3 page_title: "md5 - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-crypto-md5" 5 description: |- 6 The md5 function computes the MD5 hash of a given string and encodes it 7 with hexadecimal digits. 8 --- 9 10 # `md5` Function 11 12 `md5` computes the MD5 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 MD5 algorithm is applied 16 as defined in [RFC 1321](https://tools.ietf.org/html/rfc1321). The raw hash is 17 then encoded to lowercase hexadecimal digits before returning. 18 19 Before using this function for anything security-sensitive, refer to 20 [RFC 6151](https://tools.ietf.org/html/rfc6151) for updated security 21 considerations applying to the MD5 algorithm. 22 23 ## Examples 24 25 ``` 26 > md5("hello world") 27 5eb63bbbe01eeed093cb22bb8f5acdc3 28 ``` 29 30 ## Related Functions 31 32 * [`filemd5`](./filemd5.html) calculates the same hash from 33 the contents of a file rather than from a string value.