ObjFW  Diff

Differences From Artifact [55b99ed0be]:

To Artifact [43e21d118e]:


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#import "OFMD5Hash.h"
#import "OFSHA1Hash.h"
#import "OFAutoreleasePool.h"

int _OFString_Hashing_reference;

@implementation OFString (Hashing)
- (OFString*)md5Hash
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFMD5Hash *hash = [OFMD5Hash md5Hash];
	uint8_t *digest;
	char ret_c[32];
	size_t i;

	[hash updateWithBuffer: string
			ofSize: length];
	digest = [hash digest];







|


|







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#import "OFMD5Hash.h"
#import "OFSHA1Hash.h"
#import "OFAutoreleasePool.h"

int _OFString_Hashing_reference;

@implementation OFString (Hashing)
- (OFString*)MD5Hash
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFMD5Hash *hash = [OFMD5Hash MD5Hash];
	uint8_t *digest;
	char ret_c[32];
	size_t i;

	[hash updateWithBuffer: string
			ofSize: length];
	digest = [hash digest];
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

	[pool release];

	return [OFString stringWithCString: ret_c
				    length: 32];
}

- (OFString*)sha1Hash
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFMD5Hash *hash = [OFSHA1Hash sha1Hash];
	uint8_t *digest;
	char ret_c[40];
	size_t i;

	[hash updateWithBuffer: string
			ofSize: length];
	digest = [hash digest];







|


|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

	[pool release];

	return [OFString stringWithCString: ret_c
				    length: 32];
}

- (OFString*)SHA1Hash
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFMD5Hash *hash = [OFSHA1Hash SHA1Hash];
	uint8_t *digest;
	char ret_c[40];
	size_t i;

	[hash updateWithBuffer: string
			ofSize: length];
	digest = [hash digest];