![](/img/trans.png)
[英]How to combine md5 hashes to of byte array to get equalent md5 hash of combined array
[英]How to send MD5 hash of empty byte array?
我需要从PHP向C#WEB API发送请求。 作为身份验证的一部分,它需要一个空字节数组的MD5哈希。
如何在PHP上生成一个空字节数组的MD5哈希? 我会在C#中这样做。
byte[] Content = new byte[0];
using (var md5 = MD5.Create())
{
return md5.ComputeHash(content);
}
https://superuser.com/questions/557925/how-can-zero-byte-files-generate-a-hash-value
如果您无法用PHP计算它,则只需使用一个常量,对于空数组,请使用该哈希值。
您可以通过多种方式进行操作:
$hash = md5(null, true);
// or
$hash = md5('', true);
// or
$hash = md5(false, true);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.