![](/img/trans.png)
[英]How To Rewrite URL in php using htaccess file. what change in php code
[英]What code it is and how to rewrite in php
我从一个 api 提供者那里得到了这个代码
不确定它的 asp .net 或其他东西
需要转换成php
我尝试了一些在线工具,但没有运气。
Some One 帮助它是什么代码以及我如何转换为 php。
string CrypCode = (DateTime.Now.Year.ToString()+ (Seed + DateTime.Now.DayOfYear.ToString()));
System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] bs = System.Text.Encoding.UTF8.GetBytes(CrypCode);
bs = x.ComputeHash(bs);
System.Text.StringBuilder s = new System.Text.StringBuilder();
foreach (byte b in bs)
{
s.Append(b.ToString("x2").ToLower());
}
string KEY = s.ToString();
return KEY;
我记得当我曾经使用 VB.NET 时。 哈希很头疼。 我看到你正在尝试 md5 哈希密码。 在 php 中它很简单。 不知道为什么微软的语言很长。 他们一定有他们的理由。 信不信由你在 php 它的一行。
$crypcode = date("Y") + ($seed + date("z"));
$key = md5($crypcode);
return $key;
http://php.net/manual/en/function.md5.php
http://php.net/manual/en/function.date.php
https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.md5cryptoserviceprovider
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.