View Source Bitcoinex.Utils (bitcoinex v0.1.8)

Contains useful utility functions used in Bitcoinex.

Link to this section Summary

Types

The pad_type describes the padding to use.

Link to this section Types

@type pad_type() :: :leading | :trailing

The pad_type describes the padding to use.

Link to this section Functions

@spec double_sha256(iodata()) :: binary()
@spec hash160(iodata()) :: binary()
@spec int_to_big(non_neg_integer(), non_neg_integer()) :: binary()
Link to this function

pad(bin, byte_len, pad_type)

View Source
@spec pad(bin :: binary(), byte_len :: integer(), pad_type :: pad_type()) :: binary()

pads binary according to the byte length and the padding type. A binary can be padded with leading or trailing zeros.

@spec replicate(term(), integer()) :: [term()]
@spec sha256(iodata()) :: binary()
@spec xor_bytes(binary(), binary()) :: binary()