Elixir implementation of the hashcash algorigthm as described in http://hashcash.org and https://en.wikipedia.org/wiki/Hashcash
Based loosely on https://github.com/grempe/hashcash.git
The tests are a more complete set of examples, however:
Import a hashcash stamp
stamp = Hashcash.stamp(stamp_string)
Verify a stamp
case Hashcash.verify(stamp,"[email protected]") do
{:ok, :verified } -> :yay
{:error, :unproven} -> :work_didnt_happen
{:error, :resource_mismatch} -> :valid_resource_didnt_match
{:error, :resource_expired} -> :time_stamp_is_too_old # 2 days
end
Available in Hex.
The package can be added to your project:
1. Add `hashcash` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:hashcash, "~> 1.0"}]
end
```