View Source BitcoinLib.Script.Opcodes.Crypto.Hash160 (BitcoinLib v0.4.3)

Based on https://en.bitcoin.it/wiki/Script

Word OP_HASH160 Opcode 169 Hex 0xa9 Input in Output hash Description The input is hashed twice: first with SHA-256 and then with RIPEMD-160.

Link to this section Summary

Functions

Returns <<0xa9>>

The input is hashed twice: first with SHA-256 and then with RIPEMD-160.

v()

Returns 0xa9

Link to this section Functions

@spec encode() :: <<_::8>>

Returns <<0xa9>>

examples

Examples

iex> BitcoinLib.Script.Opcodes.Crypto.Hash160.encode()
<<0xa9>>
@spec execute(%BitcoinLib.Script.Opcodes.Crypto.Hash160{}, [<<_::264>> | list()]) ::
  {:ok, [<<_::160>> | list()]}

The input is hashed twice: first with SHA-256 and then with RIPEMD-160.

examples

Examples

iex> pub_key = <<0x0218fb7aff2c6cb9c25b7cd9aa0b9bdd712e5617f07cb0c96bdda0b44c25a5d25f::264>>
...> %BitcoinLib.Script.Opcodes.Crypto.Hash160{}
...> |> BitcoinLib.Script.Opcodes.Crypto.Hash160.execute([pub_key, 3])
{:ok, [<<0x17cdc02e31846f9e7c25952700f53e9752a0a3c2::160>>, 3]}
@spec v() :: 169

Returns 0xa9

examples

Examples

iex> BitcoinLib.Script.Opcodes.Crypto.Hash160.v()
0xa9