示例#1
0
  private String genAppSign(List<NameValuePair> params) {
    StringBuilder sb = new StringBuilder();

    for (int i = 0; i < params.size(); i++) {
      sb.append(params.get(i).getName());
      sb.append('=');
      sb.append(params.get(i).getValue());
      sb.append('&');
    }
    sb.append("key=");
    sb.append(Constants.API_KEY);

    String appSign = MD5.getMessageDigest(sb.toString().getBytes()).toUpperCase();
    Log.e("orion", appSign);
    return appSign;
  }
示例#2
0
 private String genNonceStr() {
   Random random = new Random();
   return MD5.getMessageDigest(String.valueOf(random.nextInt(10000)).getBytes());
 }