![](/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.