Authored by John Tai

md5(uid).reviewed by sunkai

@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 16
17 #define kYOHOEventReportURL @"http://analysis.yohobuy.com/yas_mobile"//@"http://172.16.10.128:8081/eventreport" 17 #define kYOHOEventReportURL @"http://analysis.yohobuy.com/yas_mobile"//@"http://172.16.10.128:8081/eventreport"
18 18
19 -#define kYOHOPerformanceReportURL @"http://app.yoho.cn/collect/v2"//@"http://172.16.6.108/collect/v2" 19 +#define kYOHOPerformanceReportURL @"http://app.yoho.cn/collect/v3"//@"http://172.16.6.108/collect/v2"
20 20
21 @interface YH_EventDataSession() 21 @interface YH_EventDataSession()
22 22
@@ -12,4 +12,6 @@ @@ -12,4 +12,6 @@
12 12
13 - (NSString *)er_encodedString; 13 - (NSString *)er_encodedString;
14 14
  15 +- (NSString *)yh_md5String;
  16 +
15 @end 17 @end
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 // 7 //
8 8
9 #import "NSString+ER_URL.h" 9 #import "NSString+ER_URL.h"
  10 +#import <CommonCrypto/CommonDigest.h>
  11 +
10 12
11 @implementation NSString (ER_URL) 13 @implementation NSString (ER_URL)
12 14
@@ -21,4 +23,18 @@ @@ -21,4 +23,18 @@
21 return encodedString; 23 return encodedString;
22 } 24 }
23 25
  26 +- (NSString *)yh_md5String
  27 +{
  28 + const char *cStr = [self UTF8String];
  29 + unsigned char result[16];
  30 + CC_MD5( cStr, (CC_LONG)strlen(cStr), result); // This is the md5 call
  31 + return [NSString stringWithFormat:
  32 + @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
  33 + result[0], result[1], result[2], result[3],
  34 + result[4], result[5], result[6], result[7],
  35 + result[8], result[9], result[10], result[11],
  36 + result[12], result[13], result[14], result[15]
  37 + ];
  38 +}
  39 +
24 @end 40 @end
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 #import <UIKit/UIKit.h> 16 #import <UIKit/UIKit.h>
17 #import "YH_EventUtil.h" 17 #import "YH_EventUtil.h"
18 #import "YHEventReport.h" 18 #import "YHEventReport.h"
  19 +#import "NSString+ER_URL.h"
19 20
20 @implementation YH_PerformanceAppInfo 21 @implementation YH_PerformanceAppInfo
21 22
@@ -142,7 +143,7 @@ @@ -142,7 +143,7 @@
142 143
143 -(NSString *)uid{ 144 -(NSString *)uid{
144 _uid = [[YHEventReport sharedInstance] uid]; 145 _uid = [[YHEventReport sharedInstance] uid];
145 - return _uid; 146 + return [_uid yh_md5String];
146 } 147 }
147 148
148 -(NSString *)sid{ 149 -(NSString *)sid{