Differences From Artifact [98d19965a9]:
- File src/OFString+CryptographicHashing.m — part of check-in [1a86b8175b] at 2022-02-12 07:46:07 on branch trunk — Update copyright (user: js, size: 2336) [annotate] [blame] [check-ins using]
To Artifact [30b5bea6f8]:
- File
src/OFString+CryptographicHashing.m
— 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: 2355) [annotate] [blame] [check-ins using] [more...]
| ︙ | ︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
id <OFCryptographicHash> hash =
[class hashWithAllowsSwappableMemory: true];
size_t digestSize = [class digestSize];
const unsigned char *digest;
char cString[digestSize * 2];
[hash updateWithBuffer: self.UTF8String length: self.UTF8StringLength];
digest = hash.digest;
for (size_t i = 0; i < digestSize; i++) {
uint8_t high, low;
high = digest[i] >> 4;
low = digest[i] & 0x0F;
| > | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
id <OFCryptographicHash> hash =
[class hashWithAllowsSwappableMemory: true];
size_t digestSize = [class digestSize];
const unsigned char *digest;
char cString[digestSize * 2];
[hash updateWithBuffer: self.UTF8String length: self.UTF8StringLength];
[hash calculate];
digest = hash.digest;
for (size_t i = 0; i < digestSize; i++) {
uint8_t high, low;
high = digest[i] >> 4;
low = digest[i] & 0x0F;
|
| ︙ | ︙ |