diff --git a/SDWebImageLottieCoder/Classes/SDImageLottieCoder.m b/SDWebImageLottieCoder/Classes/SDImageLottieCoder.m index 796af93..de7c310 100644 --- a/SDWebImageLottieCoder/Classes/SDImageLottieCoder.m +++ b/SDWebImageLottieCoder/Classes/SDImageLottieCoder.m @@ -15,6 +15,7 @@ #else @import librlottie; #endif +#import #define SD_TWO_CC(c1,c2) ((uint16_t)(((c2) << 8) | (c1))) @@ -58,6 +59,18 @@ static CGSize SDCalculateThumbnailSize(CGSize fullSize, BOOL preserveAspectRatio return CGSizeMake(resultWidth, resultHeight); } +static NSString *SDCalculateMD5(NSString *input) { + const char* str = [input UTF8String]; + unsigned char result[CC_MD5_DIGEST_LENGTH]; + CC_MD5(str, (CC_LONG)strlen(str), result); + + NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2]; + for(int i = 0; i