View Source BitcoinLib.Script.Opcodes.Crypto.Hash256 (BitcoinLib v0.4.7)

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

Word OP_HASH256 Opcode 170 Hex 0xaa Input in Output hash The input is hashed two times with SHA-256.

Link to this section Summary

Functions

Returns <<0xaa>>

The input is hashed two times with SHA-256.

v()

Returns 0xaa

Link to this section Types

@type t() :: BitcoinLib.Script.Opcodes.Crypto.Hash256

Link to this section Functions

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

Returns <<0xaa>>

examples

Examples

iex> BitcoinLib.Script.Opcodes.Crypto.Hash256.encode()
<<0xaa>>
@spec execute(t(), [bitstring() | list()]) :: {:ok, [<<_::256>> | list()]}

The input is hashed two times with SHA-256.

examples

Examples

iex> pub_key = <<0x0218fb7aff2c6cb9c25b7cd9aa0b9bdd712e5617f07cb0c96bdda0b44c25a5d25f::264>>
...> %BitcoinLib.Script.Opcodes.Crypto.Hash256{}
...> |> BitcoinLib.Script.Opcodes.Crypto.Hash256.execute([pub_key, 3])
{:ok, [<<0x65bcba68347f2eddd470e427c957a7cee6406e041ffd80ed3f499cec868a8ac7::256>>, 3]}
@spec v() :: 170

Returns 0xaa

examples

Examples

iex> BitcoinLib.Script.Opcodes.Crypto.Hash256.v()
0xaa