






#import "NSString+SubCar.h"
#import <CommonCrypto/CommonCrypto.h>

@implementation NSString (SubCar)

- (NSString *)her {
    const char* inputStr = [self UTF8String];
    unsigned char result[CC_MD5_DIGEST_LENGTH];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    CC_MD5(inputStr, (CC_LONG)strlen(inputStr), result);
#pragma clang diagnostic pop
    NSMutableString *yet = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2];
    for(int i = 0; i<CC_MD5_DIGEST_LENGTH; i++) {
        [yet appendFormat:@"%02x",result[i]];
    }
    return yet;
}

@end
