Skip to content

danj3/elixir-hashcash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Hashcash

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

Usage

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,"valid_resourcd@example.com") 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

Installation

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
```

About

hashcash proof-of-work implementation

Resources

Stars

Watchers

Forks

Packages

No packages published