npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

blake2js

v1.0.0

Published

Node bindings for the Blake2 hashing library

Readme

Blake2-JS

Straightforward bindings for the Blake2 hashing library.

License Travis-CI Coveralls npm

Package

About Blake2

BLAKE2 is a cryptographic hash function faster than MD5, SHA-1, SHA-2, and SHA-3, yet is at least as secure as the latest standard SHA-3. - official website

This modules relies on the official C implementation of the library and requires a c++11 capable compiler. It is compatible with node 0.10.x and greater (I've not tried with earlier versions but there shouldn't be major problems).

Installation

$ npm install --save-dev blake2js

Usage

var blake2 = require('blake2js'); // or let/const
import blake2 from 'blake2js';  // in ES6+ syntax

Method: hash

hash(algorithm, data, options, encoding) <Buffer> | <String>

  • algorithm <String>
    Algorithm to use, can either be "blake2s", "blake2sp", "blake2b" or "blake2bp".
  • data <Object> | <Buffer> | <String>
    The data can be passed as an object whose "raw" property contains a string/Buffer to be hashed and an "encoding" property which indicates the encoding of the raw field (ignored if buffer). Otherwise you can directly pass a Buffer or a string (utf-8 encoding is assumed).
  • options <Object>
    Hash options (see below).
  • encoding
    This determines the output format for the hash; if none is specified a Buffer is returned.

Method: createHash

createHash(algorithm, options) <Hash>

  • algorithm <String>
    Blake2 algorithm (see above for valid values).
  • options <Object>
    • outlen <Number>
      Output's length in bytes. Must be a positive number smaller or equal to the maximum outbut bytes (32 for blake2s(p) and 64 for blake2b(p)).
    • key <Buffer> | <String>
      If specified this will produced a keyed hash using the specified key.
    • encoding <String>
      This is the key's encoding, if not specified utf-8 is assumed.

Class: Hash

constructor(options)

  • options <Object>
    Hash options (see above).

update(data[, encoding]) <Hash>

  • data <Buffer> | <String>
    Data to update the hash with.
  • encoding <String> If data is a string, the encoding will be used to decode it. If none is specified then utf-8 is assumed.
  • returns: the instance itself (useful for chaining).

digest(encoding) <Buffer> | <String>

  • Completes the hash and returns the result. By default returns a Buffer, if an argument is passed it will be used as encoding to stringify it. (digest(encoding) === digest().toString(encoding))

An important thing is that Hash instances can be used as transform streams, exactly as documented on node's crypto api.