# vinkla/hashids

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/vinkla-hashids).**

5,436 stars · 413 forks · PHP · MIT

## Links

- GitHub: https://github.com/vinkla/hashids
- Homepage: https://hashids.org/php
- awesome-repositories: https://awesome-repositories.com/repository/vinkla-hashids.md

## Topics

`composer-packages` `database-ids` `encoding` `hash` `hashids` `ids` `php` `php-library`

## Description

Hashids is a PHP library for the reversible transformation of numeric and hexadecimal database keys into non-sequential, masked alphanumeric identifiers. It functions as a tool to encode numeric database identifiers into short strings and decode them back to their original values.

The project focuses on hiding internal database primary keys and sequential record counts in public URLs to prevent data scraping and exposure. It utilizes a secret salt for deterministic mapping and supports customizable character sets to ensure unique identifiers across different projects.

The library provides utilities for both numeric and hexadecimal ID obfuscation, enabling the generation of masked identifiers that can be restored to their original format for secure data handling.

## Tags

### Security & Cryptography

- [Database ID Masking](https://awesome-repositories.com/f/security-cryptography/cryptography/key-generation-tools/key-obfuscators/database-id-masking.md) — Hides internal database primary keys by converting numeric IDs into non-sequential strings to prevent record enumeration.
- [Deterministic ID Salts](https://awesome-repositories.com/f/security-cryptography/configuration-encryption/salt-configuration/deterministic-id-salts.md) — Uses a secret salt to scramble character mappings and ensure unique, deterministic IDs across projects.
- [Encoding Decoders](https://awesome-repositories.com/f/security-cryptography/encoding-decoders.md) — Provides a reversible process to encode numeric identifiers and decode them back to their original values.
- [Numeric Identifier Masking](https://awesome-repositories.com/f/security-cryptography/encoding-decoders/numeric-identifier-masking.md) — Encodes and decodes integers into masked identifiers to keep internal system IDs private.
- [Numeric Obfuscation Libraries](https://awesome-repositories.com/f/security-cryptography/numeric-obfuscation-libraries.md) — Provides a PHP library to encode numeric database identifiers into short non-sequential strings and decode them back.
- [Numeric Obfuscations](https://awesome-repositories.com/f/security-cryptography/numeric-obfuscations.md) — Encodes numeric database identifiers into short, non-sequential strings to hide primary keys. ([source](https://cdn.jsdelivr.net/gh/vinkla/hashids@master/README.md))

### Programming Languages & Runtimes

- [Custom Alphabet Encodings](https://awesome-repositories.com/f/programming-languages-runtimes/character-encoding-utilities/custom-alphabet-encodings.md) — Implements encoding using a customizable alphabet to transform numeric IDs into short, readable strings.

### User Interface & Experience

- [Database Identifier Masking](https://awesome-repositories.com/f/user-interface-experience/visitor-identification/visitor-identifier-linking/identifier-obfuscation/database-identifier-masking.md) — Hides primary keys from end users by converting integers into non-sequential, YouTube-like identifiers.

### Data & Databases

- [Hexadecimal ID Obfuscations](https://awesome-repositories.com/f/data-databases/data-serialization-formats/output-formatting-systems/string-converters/hexadecimal-decoders/hexadecimal-id-obfuscations.md) — Obfuscates long hexadecimal strings into masked identifiers and restores them for secure data handling. ([source](https://cdn.jsdelivr.net/gh/vinkla/hashids@master/README.md))

### Web Development

- [URL Identifiers](https://awesome-repositories.com/f/web-development/url-identifiers.md) — Generates short, URL-friendly alphanumeric identifiers to avoid exposing sequential record counts.
