Overview
Comment: | OFHash: Take void* and unify convenience methods. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c1060114f66276e8e1da880c3d29b79a |
User & Date: | js on 2012-07-03 20:16:12 |
Other Links: | manifest | tags |
Context
2012-07-03
| ||
20:17 | Get rid of a warning with clang trunk. check-in: 6ec1bc64a4 user: js tags: trunk | |
20:16 | OFHash: Take void* and unify convenience methods. check-in: c1060114f6 user: js tags: trunk | |
15:50 | Merge branch 'runtime' check-in: 4c4fdb3429 user: js tags: trunk | |
Changes
Modified configure.ac from [0661dee44a] to [13fd0aa2b6].
whitespace changes only
Modified src/OFDataArray+Hashing.m from [84f38acc0a] to [1c7d02816a].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + | int _OFDataArray_Hashing_reference; @implementation OFDataArray (Hashing) - (OFString*)MD5Hash { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; |
︙ | |||
53 54 55 56 57 58 59 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | - + | encoding: OF_STRING_ENCODING_ASCII length: 32]; } - (OFString*)SHA1Hash { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; |
︙ |
Modified src/OFHash.h from [408c490e85] to [89f3a6d86f].
︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + + + + + + + - + - + | BOOL calculated; } #ifdef OF_HAVE_PROPERTIES @property (readonly, getter=isCalculated) BOOL calculated; #endif /** * \brief Creates a new hash. * * \return A new autoreleased OFHash */ + 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. * |
︙ |
Modified src/OFHash.m from [789e0520fc] to [7dbf281922].
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | + + + + + - + | #include "config.h" #import "OFHash.h" #import "OFNotImplementedException.h" @implementation OFHash + hash { return [[[self alloc] init] autorelease]; } + (size_t)digestSize { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (size_t)blockSize { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } |
︙ |
Modified src/OFMD5Hash.h from [95439e160f] to [a6c35b82ad].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 | - - - - - - - | uint32_t buffer[4]; uint32_t bits[2]; union { uint8_t u8[64]; uint32_t u32[16]; } in; } |
Modified src/OFMD5Hash.m from [919ef58dc0] to [a97a93ff1c].
︙ | |||
115 116 117 118 119 120 121 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | - - - - - | buffer[0] += a; buffer[1] += b; buffer[2] += c; buffer[3] += d; } @implementation OFMD5Hash |
︙ | |||
142 143 144 145 146 147 148 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | - + + | buffer[1] = 0xEFCDAB89; buffer[2] = 0x98BADCFE; buffer[3] = 0x10325476; return self; } |
︙ |
Modified src/OFSHA1Hash.h from [ca899bde17] to [b512b356a3].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 | - - - - - | @interface OFSHA1Hash: OFHash { uint32_t state[5]; uint64_t count; char buffer[64]; uint8_t digest[OF_SHA1_DIGEST_SIZE]; } |
Modified src/OFSHA1Hash.m from [533a6ceae9] to [6e4ec96cf9].
︙ | |||
125 126 127 128 129 130 131 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | - - - - - | } else i = 0; memcpy(&buffer[j], &buf[i], length - i); } @implementation OFSHA1Hash |
︙ | |||
153 154 155 156 157 158 159 | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | - + | state[2] = 0x98BADCFE; state[3] = 0x10325476; state[4] = 0xC3D2E1F0; return self; } |
︙ |
Modified src/OFString+Hashing.m from [07ba26d618] to [e987d561c5].
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - + | int _OFString_Hashing_reference; @implementation OFString (Hashing) - (OFString*)MD5Hash { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; |
︙ | |||
52 53 54 55 56 57 58 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - + | encoding: OF_STRING_ENCODING_ASCII length: 32]; } - (OFString*)SHA1Hash { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; |
︙ |
Modified tests/OFMD5HashTests.m from [3d9bebb920] to [e7dab670c1].
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - + | - (void)MD5HashTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFMD5Hash *md5; OFFile *f = [OFFile fileWithPath: @"testfile.bin" mode: @"rb"]; |
︙ |
Modified tests/OFSHA1HashTests.m from [1cad042110] to [fea32d80e8].
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + | - (void)SHA1HashTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFSHA1Hash *sha1; OFFile *f = [OFFile fileWithPath: @"testfile.bin" mode: @"rb"]; |
︙ |