12345678910111213141516171819202122232425262728293031323334 |
- //
- // YOUPAIBBMD5.m
- // VQU
- //
- // Created by Elaine on 2021/10/29.
- // Copyright © 2021 MS. All rights reserved.
- //
- #import "YOUPAIBBMD5.h"
- #import <CommonCrypto/CommonDigest.h>
- @implementation YOUPAIBBMD5
- + (NSString* )youpaifmd5To32bit:(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<CC_MD2_DIGEST_LENGTH;i++){
- [ret appendFormat:@"%02x",result[i]];
- }
- return ret;
- }
- @end
|