github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/crypto/bcrypt.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: bcrypt - Functions - Configuration Language
     4  sidebar_title: bcrypt
     5  description: |-
     6    The bcrypt function computes a hash of the given string using the Blowfish
     7    cipher.
     8  ---
     9  
    10  # `bcrypt` Function
    11  
    12  `bcrypt` computes a hash of the given string using the Blowfish cipher,
    13  returning a string in [the _Modular Crypt
    14  Format_](https://passlib.readthedocs.io/en/stable/modular_crypt_format.html)
    15  usually expected in the shadow password file on many Unix systems.
    16  
    17  ```hcl
    18  bcrypt(string, cost)
    19  ```
    20  
    21  The `cost` argument is optional and will default to 10 if unspecified.
    22  
    23  Since a bcrypt hash value includes a randomly selected salt, each call to this
    24  function will return a different value, even if the given string and cost are
    25  the same. Using this function directly with job arguments will therefore
    26  cause spurious job updates.
    27  
    28  The version prefix on the generated string (e.g. `$2a$`) may change in future
    29  versions of Nomad.
    30  
    31  ## Examples
    32  
    33  ```shell-session
    34  > bcrypt("hello world")
    35  $2a$10$D5grTTzcsqyvAeIAnY/mYOIqliCoG7eAMX0/oFcuD.iErkksEbcAa
    36  ```