iOS md5加密(32位小写)

- (NSString *)md5To32bit:(NSString *)input {

    const char* str = [input UTF8String];

    unsigned char result[CC_MD2_DIGEST_LENGTH];

    CC_MD5(str, (CC_LONG)strlen(str), result);

    NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2];

    for(int i = 0; I

        [ret appendFormat:@"%02x",result[i]];

    }

    return ret;

}

你可能感兴趣的:(iOS md5加密(32位小写))