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

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

Word OP_SHA1 Opcode 161 Hex 0xa7 Input in Output hash The input is hashed using SHA-1.

Link to this section Summary

Functions

Returns <<0xa7>>

The input is hashed using SHA-1.

v()

Returns 0xa7

Link to this section Types

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

Link to this section Functions

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

Returns <<0xa7>>

examples

Examples

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

The input is hashed using SHA-1.

examples

Examples

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

Returns 0xa7

examples

Examples

iex> BitcoinLib.Script.Opcodes.Crypto.Sha1.v()
0xa7