github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/crypto/sha1.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: sha1 - Functions - Configuration Language
     4  description: |-
     5    The sha1 function computes the SHA1 hash of a given string and encodes it
     6    with hexadecimal digits.
     7  ---
     8  
     9  # `sha1` Function
    10  
    11  `sha1` computes the SHA1 hash of a given string and encodes it with
    12  hexadecimal digits.
    13  
    14  The given string is first encoded as UTF-8 and then the SHA1 algorithm is applied
    15  as defined in [RFC 3174](https://tools.ietf.org/html/rfc3174). The raw hash is
    16  then encoded to lowercase hexadecimal digits before returning.
    17  
    18  Collision attacks have been successfully performed against this hashing
    19  function. Before using this function for anything security-sensitive, review
    20  relevant literature to understand the security implications.
    21  
    22  ## Examples
    23  
    24  ```shell-session
    25  > sha1("hello world")
    26  2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
    27  ```