summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2018-05-31 16:06:53 -0400
committerNicoleYarroch <nicole@livio.io>2018-05-31 16:06:53 -0400
commit0d35a6cd954fb2518118bd8093c117fc4d3250da (patch)
treef89bfe4e4d12ca95083bfd256e645d85c610af8e
parenta363b7e64017819550259b0ec27ce83b1f80a654 (diff)
downloadsdl_ios-bug/issue_976_generated_SDLArtwork_name_too_long.tar.gz
Refactored computing hash string lengthbug/issue_976_generated_SDLArtwork_name_too_long
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLink/SDLArtwork.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLArtwork.m b/SmartDeviceLink/SDLArtwork.m
index b57838f34..dd0545616 100644
--- a/SmartDeviceLink/SDLArtwork.m
+++ b/SmartDeviceLink/SDLArtwork.m
@@ -106,9 +106,9 @@ NS_ASSUME_NONNULL_BEGIN
unsigned char hash[CC_MD5_DIGEST_LENGTH];
CC_MD5([data bytes], (CC_LONG)[data length], hash);
- NSMutableString *formattedHash = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
+ NSMutableString *formattedHash = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH];
// HAX: To shorten the string to 16 characters, the loop has been shortened to 8 fom 16.
- for (int i = 0; i < 8; i += 1) {
+ for (int i = 0; i < CC_MD5_DIGEST_LENGTH / 2; i += 1) {
[formattedHash appendFormat:@"%02x", hash[i]];
}
return formattedHash;