Perl中md5函数的PHP模拟是什么?

我有一个Perl脚本,我需要将其转换为PHP.
什么是Perl中md5函数PHP模拟?

Perl脚本:

$hash  = md5($str1, $str2); 

PHP脚本:

 $hash  = md5($str1.$str2);

我在$hash中有不同的值.
如何在PHP中获得相同的$hash值?

谢谢.

解决方法:

看起来像您使用二进制格式的输出的perl版本:

http://perldoc.perl.org/Digest/MD5.html

md5($data,...)

This function will concatenate all arguments, calculate the MD5 digest
of this “message”, and return it in binary form. The returned string
will be 16 bytes long.

PHP中试试这个:

$hash  = md5($str1.$str2, true);

有关详细信息,请参阅PHP docs.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...