forked from PrinceMei/xTextHandler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxEncodeCommand.m
More file actions
32 lines (28 loc) · 1.11 KB
/
xEncodeCommand.m
File metadata and controls
32 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// xEncodeCommand.m
// xEncode
//
// Created by cyan on 16/6/18.
// Copyright © 2016年 cyan. All rights reserved.
//
#import "xEncodeCommand.h"
#import "xEncode.h"
@implementation xEncodeCommand
- (NSDictionary *)handlers {
static NSDictionary *_instance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_instance = @{
@"xencode.base64encode": ^NSString *(NSString *text) { return Base64Encode(text); },
@"xencode.base64decode": ^NSString *(NSString *text) { return Base64Decode(text); },
@"xencode.urlencode": ^NSString *(NSString *text) { return URLEncode(text); },
@"xencode.urldecode": ^NSString *(NSString *text) { return URLDecode(text); },
@"xencode.md5": ^NSString *(NSString *text) { return MD5(text); },
@"xencode.uppercase": ^NSString *(NSString *text) { return Uppercase(text); },
@"xencode.lowercase": ^NSString *(NSString *text) { return Lowercase(text); },
@"xencode.escape": ^NSString *(NSString *text) { return Escape(text); }
};
});
return _instance;
}
@end