GithubHelp home page GithubHelp logo

sund3rrr / blake3.cr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geopjr/blake3.cr

0.0 0.0 0.0 213 KB

Blake3 for Crystal (fork)

License: MIT License

Python 0.34% C 16.61% Assembly 81.90% Crystal 0.34% Makefile 0.18% CMake 0.60% Shell 0.03%

blake3.cr's Introduction

BLAKE3

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

Blake3 using the official BLAKE3 c implementation.

Features

  • Fast. ~2x faster than Sodium::Digest::Blake2b.
  • Uses Crystal's Digest API.
  • Keyed digests.
  • Key derivation.
  • Configurable final size.
  • Streaming final output.
  • Tested against official test vectors.
  • 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

blake3.cr's People

Contributors

didactic-drunk avatar geopjr avatar oconnor663 avatar sund3rrr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.