Skip to content

Commit

Permalink
fix: remove codes about md5 (weak hash, not safe enough)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Nov 14, 2023
1 parent 7306333 commit a9d6c78
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
2 changes: 0 additions & 2 deletions GrowingTrackerCore/Helpers/Foundation/NSData+GrowingHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

- (NSString *)growingHelper_base64String;
- (NSString *)growingHelper_utf8String;
- (NSString *)growingHelper_md5String;
- (void)growingHelper_md5value:(unsigned char *)valueArray;
- (NSData *)growingHelper_LZ4String;
- (id)growingHelper_jsonObject;
- (NSArray *)growingHelper_arrayObject;
Expand Down
27 changes: 0 additions & 27 deletions GrowingTrackerCore/Helpers/Foundation/NSData+GrowingHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,33 +120,6 @@ - (NSArray *)growingHelper_arrayObject {
}
}

- (void)growingHelper_md5value:(unsigned char *)valueArray {
CC_MD5(self.bytes, (CC_LONG)[self length], valueArray);
}

- (NSString *)growingHelper_md5String {
unsigned char result[16];
[self growingHelper_md5value:result];
NSString *retVal = [NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
result[0],
result[1],
result[2],
result[3],
result[4],
result[5],
result[6],
result[7],
result[8],
result[9],
result[10],
result[11],
result[12],
result[13],
result[14],
result[15]];
return retVal;
}

- (NSData *)growingHelper_xorEncryptWithHint:(unsigned char)hint {
id<GrowingEncryptionService> service =
[[GrowingServiceManager sharedInstance] createService:@protocol(GrowingEncryptionService)];
Expand Down

0 comments on commit a9d6c78

Please sign in to comment.