Artifact ecafca23229e05a7a77672164de83b3209997a082b6d564fd7dfc4036963f2e7:
- File
src/OFHash.h
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 1834) [annotate] [blame] [check-ins using]
/* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" /*! * @brief A protocol for classes providing hash functions. */ @protocol OFHash <OFObject> #ifdef OF_HAVE_PROPERTIES @property (readonly, getter=isCalculated) bool calculated; #endif /*! * @brief Creates a new hash. * * @return A new autoreleased OFHash */ + (instancetype)hash; /*! * @brief Returns the digest size of the hash, in bytes. * * @return The digest size of the hash, in bytes */ + (size_t)digestSize; /*! * @brief Returns the block size of the hash, in bytes. * * @return The block size of the hash, in bytes */ + (size_t)blockSize; /*! * @brief Adds a buffer to the 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 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. * * @return A buffer containing the hash */ - (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; @end