在网上搜索后,我找不到关于如何在 php 中创建哈希码的答案。
我正在写一个时事通讯工具,不想被列入黑名单,好吧,谁想要:-)
我已经检查了我的反向 DNS、SPF 和 spamhouse.org...
有人可以帮助我了解如何在 PHP 中创建哈希现金(通过示例)吗?
最佳答案
TheFox 已将 Hashcash 实现到 PHP 中,可在 Github 上获得
安装
The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to composer.json:
composer.phar require "thefox/hashcash=~1.0"
例子
该实现的示例用法是:
<?php
require 'vendor/autoload.php';
use TheFox\Pow\Hashcash;
$hashcash = new Hashcash(20, 'example@example.com');
print "hashcash stamp: '".$hashcash->mint()."'\n";
?>
另外,hashcash.org 网站上有关于如何 implement it yourself 的开发者说明。以及OS specific tools available 可以通过 PHP 中的 shell_exec()
使用
关于php - 如何在 PHP 中创建 Hashcash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10135914/