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

base11172

v1.0.0

Published

Hangul base-11172 encoder/decoder using Korean syllables

Readme

base11172

Encode any data into Korean Hangul syllables using base-11172.

11,172 Unicode Hangul syllables (가 ~ 힣, U+AC00 ~ U+D7A3) to represent arbitrary binary data. Each character carries ~13.45 bits of information, producing output ~30% the length of the original hex string.

Install

npm install base11172
# or
bun add base11172

Usage

Hex string

import { encode, decode } from "base11172";

const kor = encode("7a538344c200b87ed788809520bc82c4");
// "갂꾦댎핦쫋쮉릴콰쇁셿"

const hex = decode(kor);
// "7a538344c200b87ed788809520bc82c4"

Text (UTF-8)

import { encodeText, decodeText } from "base11172";

const kor = encodeText("Hello World!");
// "걲뱗솦홥쳤닿쉧"

const text = decodeText(kor);
// "Hello World!"

Buffer

import { encode, decodeToBuffer, encodeText } from "base11172";

// Buffer -> Hangul
const kor = encode(Buffer.from([0x00, 0xff, 0x42]));

// Hangul -> Buffer
const buf = decodeToBuffer(kor);

// Buffer via encodeText
const kor2 = encodeText(Buffer.from("hello"));

Number

import { encode, decode } from "base11172";

const kor = encode(255);    // encode(0xff)
const hex = decode(kor);    // "ff"

Array

import { encodeArray, decodeArray } from "base11172";

const encoded = encodeArray(["ff", "00", 256]);
const decoded = decodeArray(encoded);

API

| Function | Input | Output | Description | |---|---|---|---| | encode | string \| Buffer \| number | string | Hex/Buffer/number to Hangul | | decode | string | string | Hangul to hex string | | encodeText | string \| Buffer | string | UTF-8 text/Buffer to Hangul | | decodeText | string | string | Hangul to UTF-8 text | | decodeToBuffer | string | Buffer | Hangul to Buffer | | encodeArray | (string \| Buffer \| number)[] | string[] | Batch encode | | decodeArray | string[] | string[] | Batch decode |

Compression ratio

| Input | Hex length | Hangul length | Ratio | |---|---|---|---| | 8 bytes | 16 chars | 5 chars | 31.3% | | 32 bytes (SHA-256) | 64 chars | 20 chars | 31.3% | | 64 bytes | 128 chars | 39 chars | 30.5% |

How it works

  1. Input is converted to a hex string
  2. A "1" prefix is prepended to preserve leading zeros
  3. The resulting number is converted to base-11172 using BigInt
  4. Each digit is mapped to a Hangul syllable (U+AC00 + digit)
  5. Decoding reverses the process

License

MIT