ed2k

A pure crystal implementation of the ed2k (and MD4) hash algorithms for file hashing.
HEAD Latest release released

Ed2k

A pure crystal implementation of the ED2K and MD4 algorithms for file hashing.

MD4 was implemented with ED2K in mind, it was not intended to be used on its own!

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      ed2k:
        git: https://codeberg.org/Sylphrena/Ed2k.cr.git
    
  2. Run shards install

Usage

require "ed2k"

# Using file path directly
Ed2k.hexdigest "path/to/file"

# Using IO
File.open "path/to/file", "r" do |io|
  Ed2k.hexdigest io
end

Naturally, you can hash other objects as well, but this hash is almost exclusively used for files.

Development

This shard is relatively complete, but the MD4 module could be improved to match existing digest functionality in stdlib.

Contributing

  1. Fork it (https://codeberg.org/Sylphrena/Ed2k.cr)
  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

ed2k:
  git: https://codeberg.org/Sylphrena/Ed2k.cr
  
License 0BSD
Crystal >= 1.13.3

Authors

Dependencies 0

Development Dependencies 0

Dependents 0

Last synced .
search fire star recently