MYDigest.m
changeset 6 2d7692f9b6b4
parent 2 8982b8fada63
child 14 3af1d1c0ceb5
     1.1 --- a/MYDigest.m	Tue Apr 07 10:56:58 2009 -0700
     1.2 +++ b/MYDigest.m	Thu Apr 09 22:46:48 2009 -0700
     1.3 @@ -90,7 +90,7 @@
     1.4      if( !cStr || strlen(cStr)!=2*length )
     1.5          return nil;
     1.6      uint8_t digest[length];
     1.7 -    for( int i=0; i<length; i++ ) {
     1.8 +    for( size_t i=0; i<length; i++ ) {
     1.9          if( sscanf(cStr, "%2hhx", &digest[i]) != 1 )
    1.10              return nil;
    1.11          cStr += 2;
    1.12 @@ -158,7 +158,7 @@
    1.13      size_t length = self.length;
    1.14      char out[2*length+1];
    1.15      char *dst = &out[0];
    1.16 -    for( int i=0; i<length; i+=1 )
    1.17 +    for( size_t i=0; i<length; i+=1 )
    1.18          dst += sprintf(dst,"%02X", bytes[i]);
    1.19      return [[[NSString alloc] initWithBytes: out length: 2*length encoding: NSASCIIStringEncoding]
    1.20              autorelease];