eddieantonio/bcrypt
Composer 安装命令:
composer require eddieantonio/bcrypt
包简介
Bcrypt class stolen from the internet, for use with Composer.
README 文档
README
Forked (from myself) at BitBucket.
This is my personal Bcrypt wrapper class-thing I use in my projects for Bcrypting buisness. It was mostly not written by me -- check the file comment in the file for all the peeps I attribute this file to. That said, a quick check on the internet shows a bajillion and one files exactly like this one, all with different names. THE PEOPLE'S BCRYPT MINILIBRARY... THING.
It is based on Andrew Moore's answer on StackOverflow. If you're
using PHP 5.5 or greater, use password_hash instead.
Use at your own risk. I offer absolutely no warranty on the cryptographic amazingness of this library, nor do any of the original authors... probably.
Usage
Use the convenience functions to do some simple hashing and verifying of hashes.
$hashed = \Bcrypt\hash('this is a random string'); // elsewhere... $plain_text_password = //... if (\Bcrypt\verify($plain_text_password, $user_pass_hash)) { login(); }
For more fine-grained control, instantiate a Bcrypt object:
// Control the prefix, number of rounds... $bcrypt = new \Bcrypt\Bcrypt('prefix', 15); // And use the instance to produce many hashes. $hashes[] = $bcrypt->hash('this is a string'); $hashes[] = $bcrypt->hash('this is another string'); // You can also do this: if ($bcrypt->verify($plain_text_password, $user_pass_hash)) { login(); }
Composer
If you're using Composer, you can just add this to your require list:
{
"require": {
"eddieantonio/bcrypt": "0.3.0"
}
}
License
Creative Commons Public Domain Declaration
Since the meat of this code was stolen from various sources who simply posted the code on the internet with no license, I consider this library to be public domain by default and take no credit in writing it; simply polishing it up such that it can be easily used with Composer.
eddieantonio/bcrypt 适用场景与选型建议
eddieantonio/bcrypt 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 52.95k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2013 年 02 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eddieantonio/bcrypt 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eddieantonio/bcrypt 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 52.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: CC0-1.0
- 更新时间: 2013-02-23