将以下代码转换成php
publicStringa(byte[]paramArrayOfByte){StringBuilderlocalStringBuilder=newStringBuilde...
public String a(byte[] paramArrayOfByte) {
StringBuilder localStringBuilder = new StringBuilder();
int i = paramArrayOfByte.length;
for (int j = 0; j < i; j++) {
String str1 = Integer.toHexString(paramArrayOfByte[j] & 0xFF);
String str2 = str1;
if (str1.length() == 1) {
str2 = "0" + str1;
}
localStringBuilder.append(str2);
}
return localStringBuilder.toString();
}
private byte[] sec(String s) throws NoSuchAlgorithmException, InvalidKeyException {
String key = "BrpsKMMjvOvlQJOfxS+eH6rdf3QfFSJ8Wjr80fzkhOmgll4EaIWCSgjPZsHQDPINXq3R3se5ldgLbBI5AhBaN/zjaBDk8ERscn";
SecretKeySpec sks = new SecretKeySpec(key.getBytes(), "HmacSHA1");
Mac mac = Mac.getInstance("HmacSHA1");
mac.init(sks);
return mac.doFinal(s.getBytes());
} 展开
StringBuilder localStringBuilder = new StringBuilder();
int i = paramArrayOfByte.length;
for (int j = 0; j < i; j++) {
String str1 = Integer.toHexString(paramArrayOfByte[j] & 0xFF);
String str2 = str1;
if (str1.length() == 1) {
str2 = "0" + str1;
}
localStringBuilder.append(str2);
}
return localStringBuilder.toString();
}
private byte[] sec(String s) throws NoSuchAlgorithmException, InvalidKeyException {
String key = "BrpsKMMjvOvlQJOfxS+eH6rdf3QfFSJ8Wjr80fzkhOmgll4EaIWCSgjPZsHQDPINXq3R3se5ldgLbBI5AhBaN/zjaBDk8ERscn";
SecretKeySpec sks = new SecretKeySpec(key.getBytes(), "HmacSHA1");
Mac mac = Mac.getInstance("HmacSHA1");
mac.init(sks);
return mac.doFinal(s.getBytes());
} 展开
1个回答
2018-08-11 · 百度知道官方认证企业
腾讯电脑管家
腾讯电脑管家是腾讯公司推出的免费安全管理软件,能有效预防和解决计算机上常见的安全风险,并帮助用户解决各种电脑“疑难杂症”、优化系统和网络环境,是中国综合能力最强、最稳定的安全软件。
向TA提问
关注
展开全部
include <iostream>
#include <stdio.h>
int jc(int m){
if(m!=1) return m*jc(m-1);
else return 1;
}
int c(int m,int n){
if(m>=n) return jc(m)/(jc(n)*jc(m-n));
}
int main(void){
int m,n;
scanf("%d%d",&m,&n);
printf("%d\n",c(m,n));
return 0;
}
#include <stdio.h>
int jc(int m){
if(m!=1) return m*jc(m-1);
else return 1;
}
int c(int m,int n){
if(m>=n) return jc(m)/(jc(n)*jc(m-n));
}
int main(void){
int m,n;
scanf("%d%d",&m,&n);
printf("%d\n",c(m,n));
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询