MD5 암호화 소스

IPhone 2014.01.20 14:50


- (NSString *) md5:(NSString *) input

{

    const char *cStr = [input UTF8String];

    unsigned char digest[16];

    CC_MD5( cStr, strlen(cStr), digest ); // This is the md5 call

    

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

    

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

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

    

    return  output;

    

}

신고
Posted by genius3k

티스토리 툴바