Skip to content

Commit

Permalink
fix: 数据加密模块返回值错误
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao authored and lvyuqiang committed Oct 15, 2021
1 parent 485131c commit 343f79f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Services/Encryption/GrowingDataEncoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
@implementation GrowingDataEncoder

- (NSData *_Nonnull)encryptEventData:(NSData *_Nonnull)data factor:(unsigned char)hint {
NSMutableData *dataM = [[NSMutableData alloc] initWithLength:data.length];
NSMutableData *result = [[NSMutableData alloc] initWithLength:data.length];
const unsigned char *p = data.bytes;
unsigned char *q = dataM.mutableBytes;
unsigned char *q = result.mutableBytes;

for (NSUInteger i = 0; i < data.length; i++, p++, q++) {
*q = (*p ^ hint);
}
return data;
return result;
}

@end

0 comments on commit 343f79f

Please sign in to comment.