Standard Library Hash Functions

function

ripemd160

ripemd160 computes the Ripemd160 hash of a value.

Inputs

  • Name
    value
    Description

    The hex-encoded value to hash.

Output

  • Name
    value
    Description

    The hashed result.

Example using ripemd160

output "hashed_data" {
    value = ripemd160(encode_hex("hello, world"))
}
// > hashed_data: 0XA3201F82FCA034E46D10CD7B27E174976E241DA2


function

sha256

sha256 computes the sha256 hash of a value.

Inputs

  • Name
    value
    Description

    The hex-encoded value to hash.

Output

  • Name
    value
    Description

    The hashed result.

Example using sha256

output "hashed_data" {
    value = sha256(encode_hex("hello, world"))
}
// > hashed_data: 0x09ca7e4eaa6e8ae9c7d261167129184883644d07dfba7cbfbc4c8a2e08360d5b


Was this page helpful?