PHP SHA3功能 [英] PHP SHA3 functionality

查看:149
本文介绍了PHP SHA3功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一个框架或功能允许我使用SHA3-512?
我不希望像 Strawbrary 这样的扩展名

解决方案

有可能。 可能已经太晚了,但我已经在 pure-PHP 实现这里上工作: $ b


  • SHA3-224 / 256/384/512
  • SHAKE128 / 256(任意输出大小) li>
  • LGPL 3 +

  • 适用于 PHP 5.2 + (相对较老的 PHP 而言相当慢)
  • 不需要扩展

  • 经过充分测试。

  • 根据 C 中的(公有领域)参考实现。

  • 任意输入大小。


    这是一个简单快速的实现,在 PHP (这意味着远慢于C )。由于这纯粹是CPU绑定,因此 PHP 7.0 的运行速度比 PHP 5.6 快4倍。 (55kB / s在这里)



    罚款只需一个小输入。正确处理一个巨大的输入,只需花费 CPU 几分钟即可。



    我希望它有帮助。


    Is there a framework or function that allows me to use SHA3-512? I don't want a extension like Strawbrary

    解决方案

    It's possible.

    Maybe too late, but I've worked on a pure-PHP implementation here:

    • SHA3-224/256/384/512
    • SHAKE128/256 (arbitrary output size)
    • LGPL 3+
    • Works in PHP 5.2+ (considerably slower on older PHP)
    • No extensions required.
    • Moderately well tested.
    • Based on the (public domain) reference implementation in C.
    • Arbitrary input size.

    It is a simple and fast implementation in PHP (which means far slower than C). Since this is purely "CPU-bound", PHP 7.0 runs 4x faster than PHP 5.6. (55kB/s here)

    Fine with a small input. Correctly handles a huge input, just hogs CPU for minutes.

    I hope it helps.

    这篇关于PHP SHA3功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆