GithubHelp home page GithubHelp logo

derhuerst / blake3-native Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 15 KB

[deprecated] – Node.js bindings to the BLAKE3 hash function.

Home Page: https://github.com/derhuerst/blake3-native#blake3-native

License: ISC License

JavaScript 38.19% Rust 61.81%
blake3 hash native

blake3-native's Introduction

blake3-native

Deprecated. Use the blake3 npm package.


Node.js bindings to the BLAKE3 hash function.

⚠️ This lib is a work-in-progress, check out the Issues page for things to be done. I'm a Rust newbie, so expect non-idiomatic code!

npm version build status ISC-licensed minimum Node.js version chat with me on Gitter support me on Patreon

BLAKE3 is a cryptographic hash function that is:

  • Much faster than MD5, SHA-1, SHA-2, SHA-3, and BLAKE2.
  • Secure, unlike MD5 and SHA-1. And secure against length extension, unlike SHA-2.
  • Highly parallelizable across any number of threads and SIMD lanes, because it's a Merkle tree on the inside.
  • Capable of verified streaming and incremental updates, again because it's a Merkle tree.
  • A PRF, MAC, KDF, and XOF, as well as a regular hash.
  • One algorithm with no variants, which is fast on x86-64 and also on smaller architectures.

NOTE: BLAKE3 is not a password hashing algorithm, because it's designed to be fast, whereas password hashing should not be fast. If you hash passwords to store the hashes or if you derive keys from passwords, we recommend Argon2.

Installation

npm install blake3-native

Usage

hashing a single chunk of data

const blake3 = require('blake3-native')

const buf = str => Buffer.from(str, 'utf8')

console.log('at once:', blake3.hash(buf('some input!')))
// 948abea72a9c6bd221d734457c15def1be448efef2d48b91882e73cd9254f0bb

hashing chunks of data continuously

createHash roughly follows the Node createHash API.

const h = blake3.createHash()

h.update(buf('some '))
h.update(buf('input!'))
console.log('chunked:', h.digest())
// 948abea72a9c6bd221d734457c15def1be448efef2d48b91882e73cd9254f0bb

Contributing

If you have a question or need support using blake3-native, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

blake3-native's People

Contributors

derhuerst avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

blake3-native's Issues

write a benchmark

We should also compare the performance with the native BLAKE3 performance.

support full Node Hash API

Node Hashes

  • are Transform streams,
  • support strings and buffers with update(),
  • support an optional encoding parameter with digest().

This will make blake3-native a drop-in replacement for the Node built-in (or it's standalone nom-based version, create-hash).

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.