blake3

Version, currently 1.3.03 versions

github.com/GeopJr/blake3.cr

Blake3 for Crystal (fork)

0 stars
0 dependents
License: MIT

Nothing has been indexed for 1.3.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  blake3:
    github: GeopJr/blake3.cr
    version: ~> 1.3.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 1.3.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

BLAKE3

Crystal CI GitHub release GitHub commits since latest release (by date) for a branch

Blake3 using the official BLAKE3 c implementation.

Features

  • [x] Fast. ~2x faster than Sodium::Digest::Blake2b.
  • [x] Uses Crystal's Digest API.
  • [x] Keyed digests.
  • [ ] Key derivation.
  • [x] Configurable final size.
  • [ ] Streaming final output.
  • [x] Tested against official test vectors.
  • [x] Builds a blake3 c static library.

Speed

examples/blake3_hash.cr is approximately the same speed as b3sum with 1 thread or mmap disabled.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      blake3:
        github: GeopJr/blake3.cr
  2. Run shards install

Usage

require "blake3"
digest = Digest::Blake3.new
digest.update data
p digest.final.hexstring
output_size = 1024
digest = Digest::Blake3.new(output_size)
digest.update data
p digest.final.hexstring => ...a.very.long.string...
digest = Digest::Blake3.new(key: "super secret exactly 32 byte key")
digest.update data
p digest.final.hexstring

For further API documentation see Crystal's Digest API

Contributing

  1. Fork it (https://github.com/GeopJr/blake3.cr/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