Skip to content

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

License

Notifications You must be signed in to change notification settings

place-labs/hashcash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published