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

@fimbul-works/futhark

v1.0.0

Published

Encode and decode numbers using a custom alphabet, such as Base-62 and Futhark runes.

Readme

@fimbul-works/futhark

Futhark (Old Norse for alphabet) is a tiny, zero-dependency utility for encoding and decoding numbers using configurable alphabets - with base-62 and Elder Futhark runes bundled out of the box.

npm version TypeScript Bundle Size

Features

  • ⚡ Ultra-lightweight: Negligible bundle footprint - pure arithmetic, no dependencies.
  • 🔤 Alphabet-agnostic: Encode with any ordered character set you define.
  • 🔢 Base-62 built-in: URL-safe, case-sensitive compact number encoding.
  • ᚠ Elder Futhark built-in: Encode numbers as runic glyphs using the canonical 24-rune alphabet.
  • 🔁 Fully reversible: Every encode has a matching decode - lossless round-trips guaranteed.

Installation

npm install @fimbul-works/futhark

Quick Start

Base-62 Encoding

import { encodeBase62, decodeBase62 } from '@fimbul-works/futhark';

encodeBase62(0);         // "0"
encodeBase62(62);        // "10"
encodeBase62(123456789); // "8m0Kx"

decodeBase62("8m0Kx");   // 123456789

Runic Encoding

import { encodeFuthark, decodeFuthark } from '@fimbul-works/futhark';

encodeFuthark(0);   // "ᚠ"
encodeFuthark(24);  // "ᚢᚠ"
encodeFuthark(999); // "ᚢᛒᛊ"

decodeFuthark("ᚢᛒᛊ"); // 999

Custom Alphabet

Bring your own character set for domain-specific encodings:

import { encodeNumber, decodeNumber } from '@fimbul-works/futhark';

const DNA = "ACGT";

encodeNumber(0, DNA);   // "A"
encodeNumber(255, DNA); // "TTTT"

decodeNumber("TTTT", DNA); // 255

API

encodeNumber(num, alphabet)

Encodes a non-negative integer into a string using the given alphabet.

| Parameter | Type | Description | |------------|----------|--------------------------------------| | num | number | Non-negative integer to encode | | alphabet | string | Ordered character set to encode with |

Returns string. Throws on negative input or an empty alphabet.


decodeNumber(str, alphabet)

Decodes a string back into a number using the given alphabet.

| Parameter | Type | Description | |------------|----------|--------------------------------------| | str | string | Encoded string to decode | | alphabet | string | The same alphabet used to encode |

Returns number. Throws if the string contains characters not in the alphabet.


encodeBase62(num) / decodeBase62(str)

Convenience wrappers using BASE62_ALPHABET (0–9, a–z, A–Z).

encodeFuthark(num) / decodeFuthark(str)

Convenience wrappers using FUTHARK_ALPHABET (ᚠᚢᚦᚨᚱᚲᚷᚹᚺᚾᛁᛃᛇᛈᛉᛊᛏᛒᛖᛗᛚᛜᛞᛟ).

Exported Constants

import { BASE62_ALPHABET, FUTHARK_ALPHABET } from '@fimbul-works/futhark';

License

MIT License - See LICENSE file for details.


Built with ⚡ by FimbulWorks