niieani/hashids.js

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

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 2 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 16th, 2026
Created on August 11th, 2012
Open Issues & Pull Requests: 11 (+0)
GitHub issues: Enabled
Number of forks: 204
Total Stargazers: 4,288 (+0)
Total Subscribers: 34 (+0)

Repository Insights (GitGenius)

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,773 days
Stale 30+ days: 1
Stale 90+ days: 1

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

hashids.js is a JavaScript library that generates YouTube-like identifiers from numbers.

The library solves the problem of exposing sequential database IDs in user-facing URLs and APIs, which can leak information about data volume and structure. It encodes integers into short, unique, non-sequential strings that resemble YouTube video IDs, then decodes them back to the original numbers. The approach uses a mathematical encoding scheme that produces consistent, reversible transformations without requiring external storage or state.

The tool suits projects that need to obscure database IDs in public-facing contexts, such as web applications with user-accessible URLs or REST APIs. It works well for scenarios where you want to avoid revealing how many records exist in your system or the order in which they were created. The library is particularly useful when you need a lightweight, stateless solution that doesn't depend on a separate lookup table or database. Anyone considering adoption should note that this is a pure encoding mechanism, not a cryptographic hash—it provides obfuscation rather than security, so it should not be used for sensitive data protection.

The project maintains a stable codebase with infrequent but deliberate updates. Pull requests receive careful review and discussion before acceptance, indicating a thoughtful approach to changes. The maintainers respond to issues and engage with the community, though activity is measured rather than rapid. The project has established itself as a reference implementation, with the library available across multiple programming languages through the broader hashids ecosystem.