Download the PHP package lithemod/hash without Composer

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

Lithe Hash

A robust module for securely hashing passwords using Bcrypt. This module simplifies the process of creating, verifying, and managing password hashes, ensuring security best practices are followed.

Table of Contents

Installation

To install the lithemod/hash package, you can use Composer. Run the following command in your terminal:

This will add the package to your project's dependencies, allowing you to use the Hash class in your application.

Usage

Importing the Class

Before using the Hash class, you must import it in your PHP file:

Creating a Hash

To create a hash from a password, use the make method. The method accepts a password and an optional array of options:

Example:

Verifying a Hash

To check if a given password matches the hash, use the check method:

Example:

Checking if a Hash Needs Rehashing

You can determine if a hash needs to be rehashed (for example, if you change the cost factor) using the needsRehash method:

Example:

Understanding Bcrypt

Bcrypt is a widely-used password hashing function designed to be slow and computationally intensive, making it resistant to brute-force attacks. By using a configurable cost factor, Bcrypt allows you to increase the difficulty of hashing as hardware becomes faster.

Handling Exceptions

The make method throws an InvalidArgumentException if the cost is set outside the valid range (4 to 31). You should handle this in your code to ensure robustness:

Testing

To ensure that your installation of the lithemod/hash module works correctly, you can run the included unit tests. If you have PHPUnit installed, execute the following command in your project directory:

This will run the tests defined in the Tests namespace and validate the functionality of the Hash class.

License

This package is licensed under the MIT License. See the LICENSE file for more information.


All versions of hash with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 lithemod/hash contains the following files

Loading the files please wait ....