hashcash

Version, currently 1.0.23 versions

github.com/place-labs/hashcash

Crystal Lang implementation of Hashcash proof-of-work systems. Generates and verifies Hashcash strings.

1 stars
1 dependent
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  hashcash:
    github: place-labs/hashcash
    version: ~> 1.0.2

Then run:

shards install

shard.yml

Crystal
>= 1.0.0
License
MIT
Authors
Gab Fitzgerald, Caspian Baska, Mia Bennett

Dependencies

This version declares no dependencies.

README

hashcash

CI

Crystal Lang implemenation of Hashcash proof-of-work system.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      hashcash:
        github: place-labs/hashcash
  2. Run shards install

Usage

require "hashcash"

To generate a hashcash string:

Hashcash.generate("resource")
# => "1:20:201206222555:resource::pOWgc88+uDuefr/o:MTMxNzg2MA=="

To verify a hashcash string:

Hashcash.valid?("1:20:201206222555:resource::pOWgc88+uDuefr/o:MTMxNzg2MA==", "resource")
# => true
Hashcash.valid!("1:20:201206222555:resource::pOWgc88+uDuefr/o:MTMxNzg2MA==", "resource")
# => "1:20:201206222555:resource::pOWgc88+uDuefr/o:MTMxNzg2MA=="
# (or raises an exception if invalid)

Contributing

  1. Fork it (https://github.com/your-github-user/hashcash/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors