Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个 php 代码的 perl 等价物是什么?
$hash = hash_hmac('sha256', $all , $secret);
我尝试使用下面的代码但徒劳无功。价值观不同。
use Digest::SHA; $sha = Digest::SHA->new('sha256'); $sha->add($secret); $sha->add($all); $digest = $sha->hexdigest;
问候, 帕万
由于我的问题获得的浏览量超出了我的预期,因此我决定回答它以帮助其他有同样问题的人。我在 PHP 中找到了它的等价物。
use Digest::SHA qw(hmac_sha256_hex); $digest=hmac_sha256_hex($all, $secret);
希望能帮助到你。