# jenssegers/optimus

🤖 Id obfuscation based on Knuth's multiplicative hashing method for PHP.

Repository: https://github.com/jenssegers/optimus
Canonical: https://ross.abutalabs.com/products/jenssegers-optimus
Homepage: https://jenssegers.com
Language: PHP
License: MIT
License Family: permissive
Topics: obfuscation, ids, optimus, hashids, transformations, laravel
Last push: 2024-03-27T22:24:53+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4140, "days_push": 889, "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 1275, forks 75 (observed 2026-08-28T04:04:12.937656+00:00)

## What it is
A PHP library that obfuscates internal integer IDs using Knuth's multiplicative hashing, producing reversible obfuscated integers instead of random strings. It includes a CLI 'spark' command to generate the required prime, inverse, and random key values, and integrates easily with Laravel.

## Use cases
- hide sequential database ids in urls
- obfuscate integer primary keys in an api
- reversible id obfuscation in php
- alternative to hashids that returns integers
- generate optimus prime and inverse keys
- prevent enumeration of resource ids in laravel

## When to choose
- you need fast, reversible integer id obfuscation in PHP
- you want numeric obfuscated ids rather than random strings
- you use Laravel and want a shared Optimus instance via a service provider

## When to avoid
- you need cryptographically secure encryption of ids
- you need string-based short hashes like Hashids
- your application is not written in PHP

## Facets
- artifact type: library
- maturity: stable
- function: cryptography, serialization, developer-tools
- domain: web-development, security, developer-tools, apis
- platform: php, cli
- tags: id-obfuscation, knuth-hash, laravel, integer-encoding, hashids-alternative

## Member repositories
- jenssegers/optimus (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:12.937656+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-30T05:03:02.145547+00:00, confidence not recorded.
  - readme: https://github.com/jenssegers/optimus (fetched 2026-08-28T04:04:12.937656+00:00, sha 29e3a4e516cd)
  - homepage: https://jenssegers.com (fetched 2026-08-29T12:14:05.295144+00:00, sha f248c41703ca)
  - site_page: https://jenssegers.com/decoupling-releases-from-deploys-using-feature-flags (fetched 2026-08-29T12:14:05.304580+00:00, sha a3f5bde70237)
  - site_page: https://jenssegers.com/speed-up-phpstorm-with-nyan-cat (fetched 2026-08-29T12:14:05.306498+00:00, sha 07a29de58bf3)
  - site_page: https://jenssegers.com/laravel-smtp-driver-vs-api-drivers (fetched 2026-08-29T12:14:05.308198+00:00, sha dbd815356933)
- Data as of 2026-08-30T08:39:29.467469+00:00.
