Download the PHP package legitphp/hash-money without Composer

On this page you can find all versions of the php package legitphp/hash-money. 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 hash-money

Hash Money 💰

Latest Version on Packagist Tests Total Downloads PHP Version

Cache rules everything around me.

Onions? Eggs? What do you like with your hash?

Hash Money

We're serving up a performance-oriented and opinionated collection of similarity hashing algorithms for PHP. Whether you're comparing images, finding duplicates, or measuring how alike things are - we got you covered. We're riding dirty with php-vips for maximum speed. Get your FFI poppin'.

Features

Algorithms

Perceptual Hash (pHash)

DCT-based algorithm that's robust to scaling, aspect ratio changes, and minor color variations. Best for finding near-duplicate images.

Difference Hash (dHash)

Gradient-based algorithm that's faster than pHash and good at detecting similar images. It works by comparing adjacent pixels to encode the image structure.

Color Histogram Hash

Color distribution-based algorithm that captures global color patterns in images. Particularly effective for finding images with similar color palettes.

MashedHash 🥔

A comprehensive image fingerprint that "mashes" together multiple image characteristics into a single 64-bit hash. This algorithm analyzes 11 different aspects of an image to create a rich signature that captures both content and style.

Bit Layout (64 bits total):

Why use MashedHash?

Requirements

Installation

You can install the package via composer:

Installing libvips

Ubuntu/Debian:

macOS:

Then install the PHP extension:

Usage

Basic Usage

Configurable Hash Sizes

Smaller hash sizes are faster to compute and compare but may produce more false positives. Choose based on your needs:

Type Safety

Configure VIPS

Distance Interpretation

The Hamming distance between two hashes indicates how similar the images are.

Advanced Usage

Working with Hash Values

Batch Processing

Performance Optimization

Example Scripts and Benchmarks

Hash Generation Example

The package includes a comprehensive example script for testing hash generation:

Testing

Run the test suite using Pest:

For code formatting:

Performance Considerations

Use Cases

Choosing the Right Hash

Hash Type Best For Speed Key Features
pHash Near-duplicate detection, scaled/compressed variants Medium Robust to compression, scaling, minor edits
dHash Quick similarity checks, cropped images Fast Good for crops, sensitive to rotation
ColorHistogram Color-based matching, filter detection Fast Catches recolored/filtered versions
MashedHash Comprehensive matching, reducing false positives Medium 11 features including borders, textures, layout

Recommended Combinations

For social media images:

For copyright detection:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

Acknowledgments

Special thanks to the authors and contributors of the libraries that made this package possible, particularly the VIPS team for their incredible image processing library.


All versions of hash-money with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
jcupitt/vips Version ^2.5
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 legitphp/hash-money contains the following files

Loading the files please wait ....