iOS about MD5 32-bit encryption

Source: Internet
Author: User

Import Header file:

#import <CommonCrypto/CommonDigest.h>

32-bit MD5 encryption method

MD5 32-bit encryption (lowercase)
-(NSString *) MD5: (NSString *) str {



const char *CSTR = [Str utf8string];



unsigned char result[32];



CC_MD5 (CStr, strlen (CSTR), result);



return [NSString stringWithFormat:



@ "%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x",

RESULT[0],RESULT[1],RESULT[2],RESULT[3],

RESULT[4],RESULT[5],RESULT[6],RESULT[7],

RESULT[8],RESULT[9],RESULT[10],RESULT[11],

RESULT[12],RESULT[13],RESULT[14],RESULT[15]];

}

iOS about MD5 32-bit encryption

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.