Download the PHP package yzh52521/webman-hash without Composer

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

简介

webman-hash (laravel hashing) 为存储用户密码提供了安全的 Bcrypt 和 Argon2 哈希加密方式。 默认情况下,将使用 Bcrypt 进行注册和身份验证。 Bcrypt 是加密密码的一个很好的选择,因为它的「加密系数」是可调的,这意味着生成散列所需的时间可以随着硬件功率的增加而增加。当加密密码时速度慢是相对比较好的。算法对密码进行哈希运算的时间越长,恶意用户生成所有可能用于对应用程序进行暴力攻击的字符串哈希值的「彩虹表」的时间就越长。

配置

你可以在 config/plugin/yzh52521/hashing/app.php 配置文件中配置默认哈希驱动程序。目前支持三种驱动程序: BcryptArgon2 (Argon2i and Argon2id variants)。

注意:Argon2i 驱动程序需要 PHP 7.2.0 或更高版本,而 Argon2id 驱动程序则需要 PHP 7.3.0 或更高版本。

基本用法

哈希密码

你可以通过调用 Hash facade 的 make 方法来加密你的密码:

调整 Bcrypt 加密系数

如果使用 Bcrypt 算法,你可以在 make 方法中使用 rounds 选项来配置该算法的加密系数。然而,对大多数应用程序来说,默认值就足够了:

调整 Argon2 加密系数

如果使用 Argon2 算法,你可以在 make 方法中使用 memory,time 和 threads 选项来配置该算法的加密系数。然后,对大多数应用程序来说,默认值就足够了:

技巧:有关这些选项的更多信息,请查阅 关于 Argon Hash 的 PHP 官方文档

验证密码是否与哈希匹配

check 方法能为你验证一段给定的未加密字符串与给定的散列 / 哈希值是否一致:

检查密码是否需要重新散列 / 哈希

needsRehash 方法可以为你检查当散列 / 哈希的加密系数改变时,你的密码是否被新的加密系数重新加密过。某些应用程序选择在身份验证时执行这一项检查:


All versions of webman-hash with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
illuminate/hashing Version ^8.0|^9.0|^10.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 yzh52521/webman-hash contains the following files

Loading the files please wait ....