Download the PHP package niktomo/kasumi without Composer

On this page you can find all versions of the php package niktomo/kasumi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kasumi

Kasumi 霞

日本語 | English

Reversible 63-bit integer scrambling for Laravel — no bcmath, no GMP, no extra extensions.

The same scramble() call encodes and decodes — no separate methods needed.

Why

Sequential integer IDs are a liability when exposed in URLs or API responses:

Kasumi scrambles IDs into opaque, fixed-length strings at the application layer, keeping your database schema and indexes untouched.

Obfuscation, not encryption. Kasumi hides the structure of IDs but does not provide cryptographic security. The salt space is 32 bits (~2 billion values), which is brute-forceable given enough known plaintext pairs. Do not rely on Kasumi as the sole defence against unauthorized access. Always enforce server-side authorization checks independently.

How it works

Based on this algorithm, applied independently to the upper 32 bits and lower 32 bits of the input:

The function is involutory — applying it twice returns the original value:

All arithmetic uses native PHP integers. No bcmath or GMP required.

Compared to alternatives

Kasumi jenssegers/optimus hashids / sqids
Max input 63-bit (PHP_INT_MAX) 31-bit only 63-bit (needs bcmath/GMP)
Extensions none optional GMP bcmath or GMP required
API f(f(x)) = x encode + decode encode + decode
Output integer or Base36 string integer string only
Laravel built-in third-party wrapper third-party wrapper

Requirements

Installation

Generate a salt and write it to .env:

This adds KASUMI_SCRAMBLE_SALT=<odd integer> to your .env. Keep this value secret and stable — changing it invalidates all existing scrambled values.

Usage

Facade

Dependency Injection

Standalone (without Laravel)

Custom Encoder

Implement Kasumi\Encoder to use a different string representation:

ChecksumEncoder

ChecksumEncoder is a decorator that wraps any Encoder and adds tamper detection. It appends a 5-character base36 checksum derived from the inner encoding:

Output length is 2 + innerLength + 3. With Base36Encoder (14 chars), the total is 19 characters.

decode() throws \InvalidArgumentException for any string that was not produced by this encoder — wrong length, tampered prefix, or tampered body all fail.

ChecksumEncoder can also wrap a custom encoder:

Artisan Commands

Config

Publish the config file:

config/kasumi.php:

Notes

License

MIT


All versions of kasumi with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package niktomo/kasumi contains the following files

Loading the files please wait ...