MD5 加密(比较NB)

+ ( NSString *)md5StringNB:( NSString *)str

{

const char *myPasswd = [str UTF8String ];

unsigned char mdc[ 16 ];

CC_MD5 (myPasswd, ( CC_LONG ) strlen (myPasswd), mdc);

NSMutableString *md5String = [ NSMutableString string ];

[md5String appendFormat : @"%02x" ,mdc[ 0 ]];

for ( int i = 1 ; i< 16 ; i++) {

[md5String appendFormat : @"%02x" ,mdc[i]^mdc[ 0 ]];

}

return md5String;

}

你可能感兴趣的:(MD5 加密(比较NB))