62,620
社区成员
发帖
与我相关
我的任务
分享
private static byte[] getAuthenticatorSource(String Source_Addr,
String Shared_Secret, String Timestamp) throws Exception{
byte abyte2[] = new byte[100];
byte abyte1[]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};
byte abyte3[] = new byte[16];
MD5 md5 = new MD5();
System.arraycopy(Source_Addr.getBytes(), 0, abyte2, 0, Source_Addr.length());
int l = Source_Addr.length();
System.arraycopy(abyte1, 0, abyte2, l,abyte1.length);
l +=9;
System.arraycopy(Shared_Secret.getBytes(), 0, abyte2, l, Shared_Secret.length());
l +=6;
System.arraycopy(Timestamp.getBytes(), 0, abyte2, l, Timestamp.length());
md5.update(abyte2);
md5.md5final(abyte3);
return abyte3;
}