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

lifehash

v0.0.2

Published

TypeScript/JavaScript implementation of LifeHash, a visual hash algorithm

Downloads

54

Readme

LifeHash

GitHub Action Quality Gate Status code style: prettier Coverage npm

TypeScript/JavaScript implementation of LifeHash: A visual hash algorithm.

DISCLAIMER

This project is in an early development phase and has not been audited or reviewed. Use it at your own risk.

Currently, only version1 and version2 lifehashes are supported.

Description

LifeHash is a method of hash visualization based on Conway’s Game of Life that creates beautiful icons that are deterministic, yet distinct and unique given the input data.

The basic concept is to take a SHA-256 hash of the input data (which can be any data including another hash) and then use the 256-bit digest as a 16x16 pixel "seed" for running the cellular automata known as Conway’s Game of Life.

After the pattern becomes stable (or begins repeating) the resulting history is used to compile a grayscale image of all the states from the first to last generation. Using Game of Life provides visual structure to the resulting image, even though it was seeded with entropy.

Some bits of the initial hash are then used to deterministically apply symmetry and color to the icon to add beauty and quick recognizability.

Source: https://lifehash.info/

Installation

npm install lifehash

Example

import { LifeHash, LifeHashVersion } from 'lifehash';

const lifehash = LifeHash.makeFrom(input, LifeHashVersion.version2, 1, true);

lifehash.toDataUrl(); // base64 image

For more examples, check the examples folder or the tests.

Documentation

This library exports one class called LifeHash.

LifeHash

class LifeHash {
  static makeFrom(
    data: string | Uint8Array,
    version = LifeHashVersion.version2,
    module_size = 1,
    has_alpha = false,
  ): Image {
    /* */
  }

  static makeFromDigest(
    digest: Uint8Array | Buffer,
    version = LifeHashVersion.version2,
    module_size = 1,
    has_alpha = false,
  ): Image {
    /* */
  }
}

Testing


npm install
npm test

TODOs

  • [ ] Support remaining LifeHashVersions
  • [ ] Add tests
  • [ ] Enable Linting
  • [ ] Fix sonarsource coverage not working
  • [ ] Audit/review of library by 3rd party

Dependencies

We try to use only a minimal set of dependencies to reduce the attack surface of malicious code being added by one of those dependencies.

There is only 1 (non-dev) dependency:

It is managed by crypto-browserify.

Usages

Currently, the following wallets support LifeHash:

Credits

The project setup has been inspired by multiple bitcoinjs libraries, such as bip39 and bip85.

Original C++ implementation: https://github.com/BlockchainCommons/bc-lifehash

This implementation is heavily inspired by https://github.com/BlockchainCommons/bc-lifehash-python

LICENSE

MIT