iOS gets a string String’s different or value

#import 

NS_ASSUME_NONNULL_BEGIN

@interface HKXORManager: NSObject

+ (HKXORManager *)shareManager;
/**
 * Calculate the XOR value
 * @param string The string that needs to be XORed
 * @return Get the string after XOR
 */
-(NSString *)stringXOR:(NSString *)string;

@end

NS_ASSUME_NONNULL_END

  

#import "HKXORManager.h"


@implementation HKXORManager

+ (HKXORManager *)shareManager {
static HKXORManager *instance = nil;
static dispatch_once_t onceToken;
dispatch_once(
&onceToken, ^{
instance
= [[HKXORManager alloc] init];
});
return instance;
}

- (NSString *)stringXOR:(NSString *)string {
if (string.length%2) {
string = [NSString stringWithFormat:@"0%@", string span>];
}
NSString
*code = @"00";
for (int i=0; i<string.length; i=i+ 2) {
NSString
*subString = [string substringWithRange:NSMakeRange(i, 2< /span>)];
code
= [self pinxCreator:code withPinv:subString];
}
return code;
}

- (NSString *)pinxCreator:(NSString *)pan withPinv:(NSString *)pinv {
if (pan.length != pinv.length) {
return nil;
}
const char *panchar = [pan UTF8String];
const char *pinvchar = [pinv UTF8String];
NSString
*temp = [[NSString alloc] init];
for (int i = 0; i ) {
int panValue = [self charToint:panchar[i]];
int pinvValue = [self charToint:pinvchar[i]];
temp
= [temp stringByAppendingString:[NSString stringWithFormat:@"%X ",panValue^pinvValue]];
}
return temp;
}

- (int)charToint:(char)tempChar {
if (tempChar >= '0' && tempChar <='9') {
return tempChar-'0';
}
else if (tempChar >= 'A' && tempChar < = 'F' span>) {
return tempChar-'A' + 10;
}
return 0;
}

@end

#import 

NS_ASSUME_NONNULL_BEGIN

@interface HKXORManager: NSObject

+ (HKXORManager *)shareManager;
/**
 * Calculate the XOR value
 * @param string The string that needs to be XORed
 * @return Get the string after XOR
 */
-(NSString *)stringXOR:(NSString *)string;

@end

NS_ASSUME_NONNULL_END

#import "< span style="color: #800000;">HKXORManager.h"


@implementation HKXORManager

+ (HKXORManager *)shareManager {
static HKXORManager *instance = nil;
static dispatch_once_t onceToken;
dispatch_once(
&onceToken, ^{
instance
= [[HKXORManager alloc] init];
});
return instance;
}

- (NSString *)stringXOR:(NSString *)string {
if (string.length%2) {
string = [NSString stringWithFormat:@"0%@", string span>];
}
NSString
*code = @"00";
for (int i=0; i<string.length; i=i+ 2) {
NSString
*subString = [string substringWithRange:NSMakeRange(i, 2< /span>)];
code
= [self pinxCreator:code withPinv:subString];
}
return code;
}

- (NSString *)pinxCreator:(NSString *)pan withPinv:(NSString *)pinv {
if (pan.length != pinv.length) {
return nil;
}
const char *panchar = [pan UTF8String];
const char *pinvchar = [pinv UTF8String];
NSString
*temp = [[NSString alloc] init];
for (int i = 0; i ) {
int panValue = [self charToint:panchar[i]];
int pinvValue = [self charToint:pinvchar[i]];
temp
= [temp stringByAppendingString:[NSString stringWithFormat:@"%X ",panValue^pinvValue]];
}
return temp;
}

- (int)charToint:(char)tempChar {
if (tempChar >= '0' && tempChar <='9') {
return tempChar-'0';
}
else if (tempChar >= 'A' && tempChar < = 'F' span>) {
return tempChar-'A' + 10;
}
return 0;
}

@end

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3925 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.