|
100精币
public static String encodeString(String str, String str2, String str3) {
sequence++;
String format = new SimpleDateFormat("yyyyMMdd").format(new Date());
byte[ bArr = new byte[24;
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
byte[ digest = messageDigest.digest((format + str + sequence).getBytes());
for (int i = 0; i < 16; i++) {
bArr[i = digest[i;
}
messageDigest.reset();
messageDigest.update(str3.getBytes("UTF-8"));
messageDigest.update(bArr, 0, 16);
messageDigest.update("icanseeu".getBytes());
byte[ digest2 = messageDigest.digest();
for (int i2 = 0; i2 < 8; i2++) {
bArr[16 + i2 = digest2[i2;
}
} catch (UnsupportedEncodingException | NoSuchAlgorithmException unused) {
}
return android.util.Base64.encodeToString(bArr, 1);
}
}帮忙翻一下成js
|
求助知识:请将问题描述清楚,最好把你有问题的源码打包上传上来,这样更方便大家帮助你。 友情提醒:本版被采纳的主题可在 申请荣誉值 帖子申请荣誉值,获得 3点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
|