Differences From Artifact [21f208b184]:
- File
src/OFCryptographicHash.h
— part of check-in
[82801897d3]
at
2022-03-25 10:22:55
on branch trunk
— OFCryptographicHash: Add -[calculate]
Before, -[digest] would do the final calculation, however, this would
mean a property modifies state, which is bad. (user: js, size: 3386) [annotate] [blame] [check-ins using] [more...]
To Artifact [635d4f982a]:
- File src/OFCryptographicHash.h — part of check-in [5a4e00df9a] at 2022-09-25 20:14:01 on branch trunk — Document more exceptions (user: js, size: 3627) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | @property (readonly, nonatomic, getter=isCalculated) bool calculated; /** * @brief A buffer containing the cryptographic hash. * * The size of the buffer depends on the hash used. The buffer is part of the * receiver's memory pool. */ @property (readonly, nonatomic) const unsigned char *digest OF_RETURNS_INNER_POINTER; /** * @brief Creates a new cryptographic hash. * | > > | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | @property (readonly, nonatomic, getter=isCalculated) bool calculated; /** * @brief A buffer containing the cryptographic hash. * * The size of the buffer depends on the hash used. The buffer is part of the * receiver's memory pool. * * @throw OFHashNotCalculatedException The hash hasn't been calculated yet */ @property (readonly, nonatomic) const unsigned char *digest OF_RETURNS_INNER_POINTER; /** * @brief Creates a new cryptographic hash. * |
︙ | ︙ | |||
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | - (instancetype)init OF_UNAVAILABLE; /** * @brief Adds a buffer to the cryptographic hash to be calculated. * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer */ - (void)updateWithBuffer: (const void *)buffer length: (size_t)length; /** * @brief Performs the final calculation of the cryptographic hash. */ - (void)calculate; /** * @brief Resets all state so that a new hash can be calculated. * * @warning This invalidates any pointer previously returned by @ref digest. If | > > > | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - (instancetype)init OF_UNAVAILABLE; /** * @brief Adds a buffer to the cryptographic hash to be calculated. * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer * @throw OFHashAlreadyCalculatedException The hash has already been calculated */ - (void)updateWithBuffer: (const void *)buffer length: (size_t)length; /** * @brief Performs the final calculation of the cryptographic hash. * * @throw OFHashAlreadyCalculatedException The hash has already been calculated */ - (void)calculate; /** * @brief Resets all state so that a new hash can be calculated. * * @warning This invalidates any pointer previously returned by @ref digest. If |
︙ | ︙ |