MD_5值转换

作者: sdr小米 | 来源:发表于2017-05-08 10:09 被阅读0次

    +(NSString *)getMD_5StringWithString:(NSString *)intoString{

    const char *cStr = [intoString UTF8String];

    unsigned char digest[CC_MD5_DIGEST_LENGTH];

    CC_MD5( cStr, (int)strlen(cStr), digest);

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

    for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)

    {

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

    }

    return result;

    }

    相关文章

      网友评论

        本文标题:MD_5值转换

        本文链接:https://www.haomeiwen.com/subject/rflmtxtx.html