# niieani/hashids.js

A small JavaScript library to generate YouTube-like ids from numbers.

Repository: https://github.com/niieani/hashids.js
Canonical: https://ross.abutalabs.com/products/hashidsjs
Homepage: https://hashids.org/javascript
Language: TypeScript
License: MIT
License Family: permissive
Topics: hashids, javascript, database-ids, ids, hash, encoding, npm-package, node, hacktoberfest
Last push: 2026-02-12T14:52:52+00:00

## Health v2 (maintenance only)
Score: 53/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 67, release rhythm 8, longevity 100
- inputs: {"age_days": 5135, "days_push": 202, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4288, forks 204 (observed 2026-08-28T04:08:41.368104+00:00)

## What it is
Hashids is a small JavaScript/TypeScript library that generates YouTube-like short, reversible IDs from numbers, so database primary keys aren't exposed to users. It supports encoding multiple numbers into one ID, custom alphabets, salts, and minimum ID lengths, and works in browsers, Node.js, and TypeScript environments.

## Use cases
- hide database ids in urls
- generate youtube-like short ids from numbers
- encode multiple numbers into one short id
- create url-safe product or event ids
- generate confirmation codes for emails
- obfuscate primary keys in a web app

## When to choose
- you want reversible, random-looking ids from integers without exposing row counts or primary keys
- you need a tiny dependency-free library that works in browser, node, and typescript
- you need to encode several numbers into a single id and decode them back

## When to avoid
- you need security or encryption - hashids are trivially decodable and not hashes
- you want to hide user counts from ids
- you are starting a new project and prefer its successor, Sqids

## Facets
- artifact type: library
- maturity: maintenance
- function: serialization, developer-tools
- domain: developer-tools, web-development, databases
- platform: browser, cross-platform
- tags: hashids, id-generation, obfuscation, url-safe-ids, typescript, npm-package, nodejs, javascript

## Member repositories
- niieani/hashids.js (main) score 53

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:41.368104+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:21:55.533789+00:00, confidence not recorded.
  - readme: https://github.com/niieani/hashids.js (fetched 2026-08-28T04:08:41.368104+00:00, sha ce1cb1b90494)
  - homepage: https://hashids.org/javascript (fetched 2026-08-29T09:11:30.564874+00:00, sha 5ff071fedafb)
  - site_page: https://sqids.org/faq (fetched 2026-08-29T09:11:30.574465+00:00, sha e604ee26ebd8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
