bitcoin-elixir v0.0.1 Bitcoin.Util

Summary

Functions

Hash data with sha256, then hash the result with sha256

Transforms binary hash as used in the Bitcoin protocol to the hex representation that you see everywhere

Calculate the root hash of the merkle tree built from given list of hashes”

Random 64 bit nonce

Functions

double_sha256(data)
double_sha256(binary) :: Bitcoin.t_hash

Hash data with sha256, then hash the result with sha256

hash_to_hex(hash)

Transforms binary hash as used in the Bitcoin protocol to the hex representation that you see everywhere.

So basically reverse + to_hex

hex_to_hash(hex)

The opposite of hash_to_hex/1

merkle_tree_hash(list)
merkle_tree_hash([Bitcoin.t_hash]) :: Bitcoin.t_hash

Calculate the root hash of the merkle tree built from given list of hashes”

militime()
nonce64()
nonce64() :: number

Random 64 bit nonce

run_validations(funs)
run_validations(funs, struct)