
.net和Java代码转化,下面这段代码如何转化成Java代码
byte[]bytes=System.Text.Encoding.UTF8.GetBytes(password);byte[]result;System.Security...
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(password);
byte[] result;
System.Security.Cryptography.SHA512 shaM = new System.Security.Cryptography.SHA512Managed();
result = shaM.ComputeHash(bytes);
int i = 0;
while (i++ < 512) {
result = shaM.ComputeHash(result);
}
shaM.Clear();
return Convert.ToBase64String(result);
这个是java中报的错 展开
byte[] result;
System.Security.Cryptography.SHA512 shaM = new System.Security.Cryptography.SHA512Managed();
result = shaM.ComputeHash(bytes);
int i = 0;
while (i++ < 512) {
result = shaM.ComputeHash(result);
}
shaM.Clear();
return Convert.ToBase64String(result);
这个是java中报的错 展开
1个回答
展开全部
System.Security.Cryptography.SHA512 shaM = new System.Security.Cryptography.SHA512Managed(); 是个类是.net的类,要java中也有相关类要自己去写。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询