merkle v0.2.2 Merkle

Merkle module provides a macro implementing Merkle Trees in Elixir.

Summary

Types

The hexadecimal representation of a cryptographic hash

A cryptographic hash

Functions

Decodes hexadecimal string (digest) into binary string (hash)

Encodes binary string (hash) into hexadecimal string (digest)

Macros

This macro implements methods for handling Merkle Trees

Types

digest()

The hexadecimal representation of a cryptographic hash.

hash()

A cryptographic hash.

Functions

hexDecode(o)
hexDecode(digest) :: hash
hexDecode([digest]) :: [hash]

Decodes hexadecimal string (digest) into binary string (hash).

Examples

iex> Merkle.hexDecode("FABADA")
<<255, 186, 218>>
hexEncode(o)
hexEncode(hash) :: digest
hexEncode([hash]) :: [digest]

Encodes binary string (hash) into hexadecimal string (digest).

Examples

iex> Merkle.hexEncode(<<255, 186, 218>>)
"FABADA"

Macros

__using__(params)
__using__(term, {Function.t, Integer.t}) :: Module.t
__using__(term, Function.t) :: Module.t

This macro implements methods for handling Merkle Trees.

Examples

iex> defmodule Tree do
...>   use Merkle, &Merkle.Mixers.Bin.sha256/2
...> end
{:module, Tree, <<...>>, {:module, Tree.Helpers, <<...>>, {:random, 1}}}