JSPM

blake3-native

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q26630F
  • License ISC

Node.js bindings to the BLAKE3 hash function.

Package Exports

  • blake3-native

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (blake3-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.