Differences From Artifact [73f20bd87d]:
- File
src/OFString+CryptoHashing.m
— part of check-in
[951f530aee]
at
2016-07-24 00:06:30
on branch trunk
— Rename OFHash to OFCryptoHash
OFHash is too generic, as this protocol is for cryptographic hashes. It
also solves the ambiguity of the +[hash] method (which is now
+[cryptoHash]), which conflicted with -[hash] on the class itself,
resulting in classes conforming to OFHash not being able to be used as a
key in an OFDictionary. (user: js, size: 2287) [annotate] [blame] [check-ins using]
To Artifact [fc8a2533b9]:
- File
src/OFString+CryptoHashing.m
— part of check-in
[19f7dc67af]
at
2016-07-24 12:14:41
on branch trunk
— -[OFCryptoHash digest]: uint8_t -> unsigned char
While in practice they are usually the same, the C standard says that
only char does not have any alignment requirements. As (u)int*_t is
defined to be an integer type of the specified size, it does not mean
(u)int8_t needs to be char. (user: js, size: 2293) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
30 31 32 33 34 35 36 | @implementation OFString (CryptoHashing) - (OFString*)OF_cryptoHashWithClass: (Class <OFCryptoHash>)class { void *pool = objc_autoreleasePoolPush(); id <OFCryptoHash> hash = [class cryptoHash]; size_t digestSize = [class digestSize]; | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | @implementation OFString (CryptoHashing) - (OFString*)OF_cryptoHashWithClass: (Class <OFCryptoHash>)class { void *pool = objc_autoreleasePoolPush(); id <OFCryptoHash> hash = [class cryptoHash]; size_t digestSize = [class digestSize]; const unsigned char *digest; char cString[digestSize * 2]; [hash updateWithBuffer: [self UTF8String] length: [self UTF8StringLength]]; digest = [hash digest]; for (size_t i = 0; i < digestSize; i++) { |
︙ | ︙ |