php md5 分块,php md5算法,给出与c#相同的结果

我在C#中有一个散列算法,简而言之,它是:

string input = "asd";

System.Security.Cryptography.MD5 alg = System.Security.Cryptography.MD5.Create();

System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();

byte[] hash = alg.ComputeHash(enc.GetBytes(input));

string output = Convert.ToBase64String(hash);

// outputs: eBVpbsvxyW5olLd5RW0zDg==

Console.WriteLine(output);

现在我需要在php中复制这种行为,

$input = "asd";

$output = HashSomething($input);

echo $output;

我怎样才能实现它?

我检查了

> md5

> utf8_decode

> utf8_encode

> base64_encode

> base64_decode

> url_decode

但我注意到php md5最终没有得到==我错过了什么?

注意:我无法更改C#行为,因为它已经实现,并且使用此算法将密码保存在我的数据库中.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值