当当手机客户端分析——用户详细信息

 {"ArrivalDate":"预计04月20日送达","ArrivalDatePromise":"(原预计04月20日送达)","CouponAmount":"0","CouponAmountLiQuan":"0","CouponId":"","CustCreditUsed":"0.00","errorCode":"0","ExpectedDeliveryTime":"2016-4-20 15:37:46","InvoiceCategory":"0","InvoiceContent":"","InvoiceTitle":"","ObtainTotalPoints":"0","order_type":"0","OrderCreationDate":"2016-04-19 15:41:12","OrderId":"33634157908","OrderInvoiceInfo":"","OrderSendDate":"","OrderStatus":"等待到款","OrderStatusCode":"0","parent_id":"33634157908","PayType":"网上支付","PayTypeName":"网上支付","PointDeductionAmount":"0.00","ProductTotal":"168.00","rcv_zip":"300000","ReceiverAddress":"中国,天津,天津市,河西区,石宏东路8号","ReceiverFixTel":"","ReceiverMobilePhone":"18888888888","ReceiverName":"李生","ReceiverTel":"18888888888","SendCompany":"","SendCompanyTel":"","SendPackageCode":"","ShippingFee":"0.00","ShipType":"普通快递送货上门,时间不限","ShopName":"当当网","ShopType":"0","TotalActivityFee":"0.00","TotalBarginPrice":"168.00","Warehouse":"北京百货","products":[{"bargin_price":"168.00","dangdang_price":"336.00","gift_product_id":"0","gift_product_name":"","gift_quantity":"1","gift_sale_price":"0.00","product_id":"60617961","product_points":"","ProductName":"[当当自营] 意大利进口 Ferrero 费列罗 榛果威化巧克力 婚庆装 96粒","promotion_type":"102","Quantity":"1","gift_list":[],"img_url":"http:\/\/img3x1.ddimg.cn\/63\/10\/60617961-1_m_2.jpg"}],"shoplink":"暂无商家联系方式","InvoiceCategoryMsg":"","promo_model":[],"route_info":[{"desc":"提交订单","time_point":"2016-4-19 15:41:12","time_bucket":""},{"desc":"网上支付","time_point":"","time_bucket":"0-1小时"},{"desc":"款项到达","time_point":"","time_bucket":"0-1小时"},{"desc":"订单审核通过","time_point":"","time_bucket":"0-1天"},{"desc":"北京百货发货","time_point":"","time_bucket":"0-1天"},{"desc":"收货并确认","time_point":"","time_bucket":null}],"payable":"168.00","shop_id":"0","collect_promotion_type":[],"shop_promotion_type":"","CouponTitle":"礼品卡","payment_id":"9543493854","order_info":"33634157908,168.00","PayOrNot":1,"isConfirm":0,"isOverSeaOrder":false,"overSeaorderTax":false}

static const char hex_table_uc[16] = { '0', '1', '2', '3',  
                                       '4', '5', '6', '7',  
                                       '8', '9', 'A', 'B',  
                                       'C', 'D', 'E', 'F' };  
static const char hex_table_lc[16] = { '0', '1', '2', '3',  
                                       '4', '5', '6', '7',  
                                       '8', '9', 'a', 'b',  
                                       'c', 'd', 'e', 'f' };  
  
char *encodeToHex(char *buff, const uint8_t *src, int len, int type) {  
    int i;  
  
    const char *hex_table = type ? hex_table_lc : hex_table_uc;  
  
    for(i = 0; i < len; i++) {  
        buff[i * 2]     = hex_table[src[i] >> 4];  
        buff[i * 2 + 1] = hex_table[src[i] & 0xF];  
    }  
  
    buff[2 * len] = '\0';  
     
    return buff;  
}  
  
uint8_t *decodeFromHex(uint8_t *data, const char *src, int len) {  
    size_t outLen = len / 2;  
  
    uint8_t *out = data;  
  
    uint8_t accum = 0;  
    for (size_t i = 0; i < len; ++i) {  
        char c = src[i];  
        unsigned value;  
        if (c >= '0' && c <= '9') {  
            value = c - '0';  
        } else if (c >= 'a' && c <= 'f') {  
            value = c - 'a' + 10;  
        } else if (c >= 'A' && c <= 'F') {  
            value = c - 'A' + 10;  
        } else {  
            return NULL;  
        }  
  
        accum = (accum << 4) | value;  
  
        if (i & 1) {  
            *out++ = accum;  
            accum = 0;  
        }  
    }  
  
    return data;  
}

转载于:https://my.oschina.net/hex2016/blog/662375

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值