github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/website/docs/configuration/functions/md5.html.md (about)

     1  ---
     2  layout: "functions"
     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  -> **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  `md5` computes the MD5 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 MD5 algorithm is applied
    20  as defined in [RFC 1321](https://tools.ietf.org/html/rfc1321). The raw hash is
    21  then encoded to lowercase hexadecimal digits before returning.
    22  
    23  Before using this function for anything security-sensitive, refer to
    24  [RFC 6151](https://tools.ietf.org/html/rfc6151) for updated security
    25  considerations applying to the MD5 algorithm.
    26  
    27  ## Examples
    28  
    29  ```
    30  > md5("hello world")
    31  5eb63bbbe01eeed093cb22bb8f5acdc3
    32  ```
    33  
    34  ## Related Functions
    35  
    36  * [`filemd5`](./filemd5.html) calculates the same hash from
    37    the contents of a file rather than from a string value.