# vinkla/hashids

A small PHP library to generate YouTube-like ids from numbers. Use it when you don't want to expose your database ids to the user.

Repository: https://github.com/vinkla/hashids
Canonical: https://ross.abutalabs.com/products/hashids
Homepage: https://hashids.org/php
Language: PHP
License: MIT
License Family: permissive
Topics: php, hashids, database-ids, php-library, encoding, hash, composer-packages, ids
Last push: 2026-04-16T11:38:45+00:00

## Health v2 (maintenance only)
Score: 57/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 77, release rhythm 8, longevity 100
- inputs: {"age_days": 5254, "days_push": 139, "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 5429, forks 413 (observed 2026-08-28T04:09:17.994395+00:00)

## What it is
A small PHP library that generates YouTube-like short, URL-safe IDs from numbers, so numeric database IDs are not exposed to users. It supports encoding/decoding multiple numbers, custom alphabets, salted uniqueness, and minimum-length padding.

## Use cases
- hide database primary keys in urls
- generate short youtube-like ids from numbers in php
- encode multiple numbers into one id
- generate url-safe confirmation codes
- create unique-looking product or event ids

## When to choose
- you want to obfuscate sequential numeric ids in a PHP application
- you need reversible, URL-safe short ids rather than one-way hashes
- you want a tiny, well-maintained Composer package with MIT license

## When to avoid
- you need encryption or security for sensitive data - these ids are easily decodable
- you should not use it for user ids since decoding can reveal user counts
- you are starting a new project and prefer its successor Sqids

## Facets
- artifact type: library
- maturity: maintenance
- function: serialization, security, developer-tools
- domain: web-development, backend, databases, developer-tools
- platform: php, cross-platform
- tags: hashids, obfuscation, short-ids, url-safe-ids, id-encoding, composer

## Member repositories
- vinkla/hashids (main) score 57

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:17.994395+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-29T17:56:54.761164+00:00, confidence not recorded.
  - readme: https://github.com/vinkla/hashids (fetched 2026-08-28T04:09:17.994395+00:00, sha 91656a605f63)
  - homepage: https://hashids.org/php (fetched 2026-08-29T08:52:14.316048+00:00, sha 64d25e724226)
  - site_page: https://sqids.org/faq (fetched 2026-08-29T08:52:14.325108+00:00, sha e604ee26ebd8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
