ObjFW
Instance Methods | Class Methods | List of all members
<OFHash> Protocol Reference

A protocol for classes providing hash functions. More...

#import <ObjFW/OFHash.h>

Inheritance diagram for <OFHash>:
<OFObject> OFMD5Hash OFRIPEMD160Hash OFSHA1Hash OFSHA224Or256Hash OFSHA384Or512Hash OFSHA224Hash OFSHA256Hash OFSHA384Hash OFSHA512Hash

Instance Methods

(void) - updateWithBuffer:length:
 Adds a buffer to the hash to be calculated. More...
 
(const uint8_t *) - digest
 Returns a buffer containing the hash. More...
 
(bool) - isCalculated
 Returns a boolean whether the hash has already been calculated. More...
 
(void) - reset
 Resets all state so that a new hash can be calculated. More...
 
- Instance Methods inherited from <OFObject>
(Class) - class
 Returns the class of the object. More...
 
(Class) - superclass
 Returns the superclass of the object. More...
 
(bool) - isKindOfClass:
 Returns a boolean whether the object of the specified kind. More...
 
(bool) - isMemberOfClass:
 Returns a boolean whether the object is a member of the specified class. More...
 
(bool) - respondsToSelector:
 Returns a boolean whether the object responds to the specified selector. More...
 
(bool) - conformsToProtocol:
 Checks whether the object conforms to the specified protocol. More...
 
(nullable IMP) - methodForSelector:
 Returns the implementation for the specified selector. More...
 
(nullable const char *) - typeEncodingForSelector:
 Returns the type encoding for the specified selector. More...
 
(nullable id) - performSelector:
 Performs the specified selector. More...
 
(nullable id) - performSelector:withObject:
 Performs the specified selector with the specified object. More...
 
(nullable id) - performSelector:withObject:withObject:
 Performs the specified selector with the specified objects. More...
 
(bool) - isEqual:
 Checks two objects for equality. More...
 
(id) - retain
 Increases the retain count. More...
 
(unsigned int) - retainCount
 Returns the retain count. More...
 
(void) - release
 Decreases the retain count. More...
 
(id) - autorelease
 Adds the object to the topmost OFAutoreleasePool of the thread's autorelease pool stack. More...
 
(id) - self
 Returns the receiver. More...
 
(bool) - isProxy
 Returns whether the object is a proxy object. More...
 

Class Methods

(instancetype) + hash
 Creates a new hash. More...
 
(size_t) + digestSize
 Returns the digest size of the hash, in bytes. More...
 
(size_t) + blockSize
 Returns the block size of the hash, in bytes. More...
 

Detailed Description

A protocol for classes providing hash functions.

Method Documentation

+ (size_t) blockSize

Returns the block size of the hash, in bytes.

Returns
The block size of the hash, in bytes
- (const uint8_t*) digest

Returns a buffer containing the hash.

The size of the buffer depends on the hash used. The buffer is part of the receiver's memory pool.

Returns
A buffer containing the hash
+ (size_t) digestSize

Returns the digest size of the hash, in bytes.

Returns
The digest size of the hash, in bytes
+ (instancetype) hash

Creates a new hash.

Returns
A new autoreleased OFHash

Reimplemented from <OFObject>.

- (bool) isCalculated

Returns a boolean whether the hash has already been calculated.

Returns
A boolean whether the hash has already been calculated
- (void) reset

Resets all state so that a new hash can be calculated.

Warning
This invalidates any pointer previously returned by digest. If you are still interested in the previous digest, you need to memcpy it yourself before calling reset!
- (void) updateWithBuffer: (const void *)  buffer
length: (size_t)  length 

Adds a buffer to the hash to be calculated.

Parameters
bufferThe buffer which should be included into the calculation
lengthThe length of the buffer

The documentation for this protocol was generated from the following file: