定制 klg/random 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

klg/random

Composer 安装命令:

composer require klg/random

包简介

Cryptographically secure random generator for PHP.

README 文档

README

Cryptographically secure random generators for PHP.

As PHP core itself does not provide any kind of secure random generator,
extensions and other not portable means of obtaining entropy must be used.
This package provides a common interface \klg\random\RandomGenerator
for multiple secure random bit generators accessible from PHP.
It exposes the following implementations of it:
\klg\random\OpenSSLGenerator  which uses openssl_random_pseudo_bytes
\klg\random\McryptGenerator   which uses mcrypt_create_iv
\klg\random\EGDGenerator      which reads from Entropy Gathering Daemon
\klg\random\KernelGenerator   which reads from /dev/urandom
\klg\random\PHPNativeGenerator  which is slow but fully portable NRBG

Depending on availability of extensions \klg\random\RandomGeneratorFactory
will instantiate the best available implementation.

Additionally as a convenience wrapper a klg\random\SecureRandom class is
provided with few utility methods that allow generating random numbers and
cryptographic tokens (as for use in password reset procedure, etc) easily.

NOTE: Certain internal components are implemented as described in NIST
  SP 800-90A/B/C but they do NOT strictly conform to the standard nor
  they are intended to.  Standard requires extensive documentation and
  testing.

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.

统计信息

  • 总下载量: 60
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: WTFPL-2
  • 更新时间: 2012-12-07