// Path: app/src/main/java/com/didikee/cnbetareader/utils/MD5.java
// public class MD5 {
//     public static String md5(String content){
//         byte[] result;
//         try {
//             MessageDigest messageDigest = MessageDigest.getInstance("MD5");
//             messageDigest.update(content.getBytes("UTF-8"));
//             result = messageDigest.digest();
//         } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
//             return "";
//         }
//         return byte2Hex(result);
//     }
//     private static String byte2Hex(byte[] bytes) {
//         StringBuilder sb = new StringBuilder();
//         for (byte b: bytes) {
//             String hex = Integer.toHexString(b & 0xFF);
//             if (hex.length() == 1) {
//                 hex = "0" + hex;   // one byte to double-digit hex
//             }
//             sb.append(hex);
//         }
//         return sb.toString();
//     }
// }


import com.didikee.cnbetareader.utils.MD5;
import java.text.SimpleDateFormat;
import java.util.Locale;
package com.didikee.cnbetareader.network;



/**
 * Created by didik 
 * Created time 2017/2/7
 * Description: 
 */

public class RequestUrl {
    private static final int SECOND = 1000;
    private static final int MINUTE = 60 * SECOND;
    private static final int HOUR = 60 * MINUTE;
    private static final int DAY = 24 * HOUR;

    private static final SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);

    /**
     * 获取 Sid 小于 endSid 文章列表
     * @param endSid 文章Sid
     * @return 文章列表url
     */
    public static String getArticleListUrl(final String endSid) {
        StringBuilder sb = new StringBuilder();
        sb.append("app_key=10000");
        sb.append("&end_sid=").append(endSid);
        sb.append("&format=json");
        sb.append("&method=Article.Lists");
        sb.append("&timestamp=").append(System.currentTimeMillis());
        sb.append("&v=2.8.5");
// Path: app/src/main/java/com/didikee/cnbetareader/utils/MD5.java
// public class MD5 {
//     public static String md5(String content){
//         byte[] result;
//         try {
//             MessageDigest messageDigest = MessageDigest.getInstance("MD5");
//             messageDigest.update(content.getBytes("UTF-8"));
//             result = messageDigest.digest();
//         } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
//             return "";
//         }
//         return byte2Hex(result);
//     }
//     private static String byte2Hex(byte[] bytes) {
//         StringBuilder sb = new StringBuilder();
//         for (byte b: bytes) {
//             String hex = Integer.toHexString(b & 0xFF);
//             if (hex.length() == 1) {
//                 hex = "0" + hex;   // one byte to double-digit hex
//             }
//             sb.append(hex);
//         }
//         return sb.toString();
//     }
// }


// Path: app/src/main/java/com/didikee/cnbetareader/network/RequestUrl.java
import com.didikee.cnbetareader.utils.MD5;
import java.text.SimpleDateFormat;
import java.util.Locale;

package com.didikee.cnbetareader.network;



/**
 * Created by didik 
 * Created time 2017/2/7
 * Description: 
 */

public class RequestUrl {
    private static final int SECOND = 1000;
    private static final int MINUTE = 60 * SECOND;
    private static final int HOUR = 60 * MINUTE;
    private static final int DAY = 24 * HOUR;

    private static final SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);

    /**
     * 获取 Sid 小于 endSid 文章列表
     * @param endSid 文章Sid
     * @return 文章列表url
     */
    public static String getArticleListUrl(final String endSid) {
        StringBuilder sb = new StringBuilder();
        sb.append("app_key=10000");
        sb.append("&end_sid=").append(endSid);
        sb.append("&format=json");
        sb.append("&method=Article.Lists");
        sb.append("&timestamp=").append(System.currentTimeMillis());
        sb.append("&v=2.8.5");
        final String signed = MD5.md5(sb.toString() + "&mpuffgvbvbttn3Rc");