@@ -32,11 +32,11 @@ OFMD5Hash *hash = [OFMD5Hash hash]; uint8_t *digest; char cString[OF_MD5_DIGEST_SIZE * 2]; size_t i; - [hash updateWithBuffer: data + [hash updateWithBuffer: items length: count * itemSize]; digest = [hash digest]; for (i = 0; i < OF_MD5_DIGEST_SIZE; i++) { uint8_t high, low; @@ -50,11 +50,11 @@ objc_autoreleasePoolPop(pool); return [OFString stringWithCString: cString encoding: OF_STRING_ENCODING_ASCII - length: 32]; + length: OF_MD5_DIGEST_SIZE * 2]; } - (OFString*)SHA1Hash { void *pool = objc_autoreleasePoolPush(); @@ -61,11 +61,11 @@ OFSHA1Hash *hash = [OFSHA1Hash hash]; uint8_t *digest; char cString[OF_SHA1_DIGEST_SIZE * 2]; size_t i; - [hash updateWithBuffer: data + [hash updateWithBuffer: items length: count * itemSize]; digest = [hash digest]; for (i = 0; i < OF_SHA1_DIGEST_SIZE; i++) { uint8_t high, low; @@ -79,8 +79,8 @@ objc_autoreleasePoolPop(pool); return [OFString stringWithCString: cString encoding: OF_STRING_ENCODING_ASCII - length: 40]; + length: OF_SHA1_DIGEST_SIZE * 2]; } @end