p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #ffffff; background-color: #000000 }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #00b1ff; background-color: #000000 }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #ffffff; background-color: #000000; min-height: 19.0px }
span.s1 { color: #00b1ff }
span.s2 { color: #ff4647 }
span.s3 { color: #08fa95 }
span.s4 { color: #ffffff }
span.s5 { color: #de38a5 }
span.s6 { color: #8b87ff }
NSString *signValue = [NSString stringWithFormat:@"%@%@", valueJson, [Utility getCurrentTimes]];
NSMutableString * getSignString = [NSMutableString string];
NSMutableArray * mutaArray = [NSMutableArray array];
for (int i = 0; i < [signValue length]; i ++) {
[mutaArray addObject:[signValue substringWithRange:NSMakeRange(i, 1)]];
}
NSStringCompareOptions comparisonOptions = NSCaseInsensitiveSearch|NSNumericSearch|
NSWidthInsensitiveSearch|NSForcedOrderingSearch;
NSComparator sort = ^(NSString *obj1,NSString *obj2){
NSRange range = NSMakeRange(0,obj1.length);
return [obj1 compare:obj2 options:comparisonOptions range:range];
};
NSArray *resultArray2 = [mutaArray sortedArrayUsingComparator:sort];
for (NSString * oldString in resultArray2) {
[getSignString appendString:oldString];
}
//signValue为输入字符串, getSignString为最后得到字符串
原文地址:https://www.cnblogs.com/allenwuhen/p/9680476.html