Download the PHP package dsentker/url-fingerprint without Composer

On this page you can find all versions of the php package dsentker/url-fingerprint. 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 url-fingerprint

UrlFingerprint

A library that creates a unique hash value from a URL - without getting a headache.

This library aims to get a unique but consistent digest (hash result) from a URL with or without side effects. It generates equal hash results even if the parameter order in the query string is different or the URL contains encoded characters like %20.

This library uses the concept of a "Fingerprint". Depending on your settings, a specific fingerprint is generated for each URL, which contains the digest, the hash algorithm and the hashed parts of the URL.

Basic Usage

Installation & Usage

Composer 2 and PHP >= 7.4 is required.

Install url-fingerprint with composer.

Options

Configure options in the constructor to specify the way the digest is created:

Option Type Default Description
secret string (required!) Choose a secret key for the hash_hmacfunction.
hash_algo string sha256 A hashing algorithm suitable for hash_hmac().
ignore_scheme boolean false Whether to hash the scheme part of the url (https://, ftp:// etc.)
ignore_userinfo boolean false Whether to hash the user information part of the url (e.g. userinfo@host)
ignore_host boolean false Whether to hash the host name or not
ignore_port boolean false Whether to hash the port
ignore_path boolean false Whether to path of the URL (e.g. /foo/index.php)
ignore_query boolean false Whether to hash the query string parts in the URL (Keys and values).
ignore_fragment boolean false Whether to hash the fragment / hash suffix in the URL or not.

Examples

Testing

With PHPUnit: $ ./vendor/bin/phpunit tests

Contributing

If you notice bugs, have general questions or want to implement a feature, you are welcome to collaborate.

Please see CONTRIBUTING for details.

Background

Motivation

Generating a unique hash from a URL is useful, e.g. when caching API responses or for security purposes. The simple idea of just hashing the URL can turn into a difficult task. Consider the following example:

This creates the same hash value (digest) each time. But what if the order of the query string parameters is changed?

Both URLs are technically the same, but the generated digest is different.

There are more parts of a URL that you may not want to include for the hash algorithm:

All three URLs could be similar according to your requirements and should therefore generate the same hash result. This is what this library was built for. There are other things in a URL that shouldn't affect the hash value of a URL:

Predecessor

This library replaces the predecessor, the url-signature library.

Compared to the url-signature library, this library is rewritten completely and should solve the following drawbacks:


All versions of url-fingerprint with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
league/uri Version ^6.0
league/uri-components Version ^2.3
symfony/options-resolver Version ^5.3
ext-json Version *
ext-mbstring Version *
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 dsentker/url-fingerprint contains the following files

Loading the files please wait ....