31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
OFMD5Hash *md5 = [OFMD5Hash new];
OFSHA1Hash *sha1 = [OFSHA1Hash new];
OFFile *f = [OFFile newWithPath: "testfile"
andMode: "rb"];
while (![f atEndOfFile]) {
len = [f readIntoBuffer: buf
withSize: 1
andNItems: 64];
[md5 updateWithBuffer: buf
ofSize: len];
[sha1 updateWithBuffer: buf
ofSize: len];
}
[f free];
|
|
|
<
|
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
OFMD5Hash *md5 = [OFMD5Hash new];
OFSHA1Hash *sha1 = [OFSHA1Hash new];
OFFile *f = [OFFile newWithPath: "testfile"
andMode: "rb"];
while (![f atEndOfFile]) {
len = [f readNBytes: 64
intoBuffer: buf];
[md5 updateWithBuffer: buf
ofSize: len];
[sha1 updateWithBuffer: buf
ofSize: len];
}
[f free];
|