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

@blockhash/slonks-core

v0.1.0

Published

Shared Slonks model, merge, rendering, and diff utilities.

Readme

@blockhash/slonks-core

Shared Slonks utilities for the API and CLI. This package keeps the local rendering, merge, palette, attribute, and slop logic in one place so API previews and CLI mining use the same math.

Install

bun add @blockhash/slonks-core

Inside this monorepo it is consumed by @blockhash/slonks-api and @blockhash/slonks.

Exports

  • @blockhash/slonks-core/attributes: parse CryptoPunks attribute text into token traits.
  • @blockhash/slonks-core/blend: blend two 10-byte embeddings with Solidity-compatible integer rounding.
  • @blockhash/slonks-core/diff: compare generated palette pixels to original RGBA and produce slop, slop level, and mask.
  • @blockhash/slonks-core/hex: convert between Uint8Array and 0x hex.
  • @blockhash/slonks-core/imageModel: load bundled model weights, render source/merge embeddings, and compute rendered slop locally.
  • @blockhash/slonks-core/palette: CryptoPunks palette constants and decoder.

Model Data

The package includes assets/model_weights_slonk_candidate_10k_18x10_canonical.bin. By default imageModel loads that bundled file. Set SLONKS_MODEL_WEIGHTS_PATH to point at another compatible weights file when testing a different model artifact.

Important dimensions:

  • Source vocabulary: 10,000
  • Embedding width: 10 signed bytes
  • Output image: 24 x 24, or 576 palette indexes
  • Original image input: 2304 RGBA bytes
  • Slop mask: 72 bytes, MSB-first within each byte

Examples

Blend two source embeddings and compute slop for the rendered result against one original:

import { blendEmbeddings } from "@blockhash/slonks-core/blend";
import { diffRenderedEmbeddingLocal, sourceEmbeddingLocal } from "@blockhash/slonks-core/imageModel";

const survivorEmbedding = sourceEmbeddingLocal(1819);
const donorEmbedding = sourceEmbeddingLocal(7606);
const blended = blendEmbeddings(survivorEmbedding, donorEmbedding);

const originalRgba = new Uint8Array(24 * 24 * 4);
const slopResult = diffRenderedEmbeddingLocal(blended, originalRgba);

Parse CryptoPunks attribute text:

import { parseAttributesText } from "@blockhash/slonks-core/attributes";

const { punkType, attributes } = parseAttributesText("Male, Hoodie, Earring");

Compute slop from already-rendered palette pixels:

import { diffPixels } from "@blockhash/slonks-core/diff";

const generatedPixels = new Uint8Array(24 * 24);
const originalRgba = new Uint8Array(24 * 24 * 4);
const { count, slopLevel, mask } = diffPixels(generatedPixels, originalRgba);

Development

Run from the repo root:

bun test packages/core
bun run test:core

License

MIT