ObjFW  Diff

Differences From Artifact [c2e62731be]:

To Artifact [360d51ea54]:


20
21
22
23
24
25
26



27
28
29
30
31
32
33

/*!
 * @protocol OFHash OFHash.h ObjFW/OFHash.h
 *
 * @brief A protocol for classes providing hash functions.
 */
@protocol OFHash <OFObject>



@property (readonly, getter=isCalculated) bool calculated;

/*!
 * @brief Creates a new hash.
 *
 * @return A new autoreleased OFHash
 */







>
>
>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

/*!
 * @protocol OFHash OFHash.h ObjFW/OFHash.h
 *
 * @brief A protocol for classes providing hash functions.
 */
@protocol OFHash <OFObject>
/*!
 * A boolean whether the hash has already been calculated.
 */
@property (readonly, getter=isCalculated) bool calculated;

/*!
 * @brief Creates a new hash.
 *
 * @return A new autoreleased OFHash
 */
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
 * The size of the buffer depends on the hash used. The buffer is part of the
 * receiver's memory pool.
 *
 * @return A buffer containing the hash
 */
- (const uint8_t*)digest OF_RETURNS_INNER_POINTER;

/*!
 * @brief Returns a boolean whether the hash has already been calculated.
 *
 * @return A boolean whether the hash has already been calculated
 */
- (bool)isCalculated;

/*!
 * @brief Resets all state so that a new hash can be calculated.
 *
 * @warning This invalidates any pointer previously returned by @ref digest. If
 *	    you are still interested in the previous digest, you need to memcpy
 *	    it yourself before calling @ref reset!
 */
- (void)reset;
@end

OF_ASSUME_NONNULL_END







<
<
<
<
<
<
<











65
66
67
68
69
70
71







72
73
74
75
76
77
78
79
80
81
82
 * The size of the buffer depends on the hash used. The buffer is part of the
 * receiver's memory pool.
 *
 * @return A buffer containing the hash
 */
- (const uint8_t*)digest OF_RETURNS_INNER_POINTER;








/*!
 * @brief Resets all state so that a new hash can be calculated.
 *
 * @warning This invalidates any pointer previously returned by @ref digest. If
 *	    you are still interested in the previous digest, you need to memcpy
 *	    it yourself before calling @ref reset!
 */
- (void)reset;
@end

OF_ASSUME_NONNULL_END