You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
0 B

2 years ago
//
// MOBFStringUtils.h
// MOBFoundation
//
// Created by vimfung on 15-1-16.
// Copyright (c) 2015年 MOB. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
*
*/
@interface MOBFString : NSObject
/**
* URL编码
*
* @param string
* @param encoding
*
* @return
*/
+ (NSString *)urlEncodeString:(NSString *)string forEncoding:(NSStringEncoding)encoding;
/**
* URL解码
*
* @param string
* @param encoding
*
* @return
*/
+ (NSString *)urlDecodeString:(NSString *)string forEncoding:(NSStringEncoding)encoding;
/**
* 使SHA1算法进行字符串签名
*
* @param string
*
* @return
*/
+ (NSString *)sha1String:(NSString *)string;
/**
* 使MD5算法进行字符串签名
*
* @param string
*
* @return
*/
+ (NSString *)md5String:(NSString *)string;
/**
* GUID字符串
*
* @return GUID字符串
*/
+ (NSString *)guidString;
/**
* 使HMAC-SHA1进行签名
*
* @param string
* @param key
*
* @return
*/
+ (NSData *)dataByHMACSha1String:(NSString *)string forKey:(NSString *)key;
/**
使HMAC-MD5进行签名
@param string
@param key
@return
*/
+ (NSData *)dataByHMACMd5String:(NSString *)string forKey:(NSString *)key;
/**
* 使BASE64进行解码
*
* @param string
*
* @return
*/
+ (NSData *)dataByBase64DecodeString:(NSString *)string;
/**
* 使BASE64进行解码
*
* @param string
*
* @return string
*/
+ (NSString *)stringByBase64DecodeString:(NSString *)string;
/**
*
*
* @param string
*
* @return YES URLNO
*/
+ (BOOL)containsURLByString:(NSString *)string;
/**
* @brief HTTP参数字符串=&=
*
* @param string
*
* @return
*/
+ (NSDictionary *)parseURLParametersString:(NSString *)string;
/**
* @brief 16NSData
*
* @param string 16
*
* @return
*/
+ (NSData *)dataByHexString:(NSString *)string;
/**
* @brief
* @param ver
* @return 5
*/
+ (NSInteger)convertVersion:(NSString *)ver;
@end