-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdExtensions.h
46 lines (36 loc) · 1.2 KB
/
AdExtensions.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// AdExtensions.h
// securesubmission
//
// Created by AdDash on 8/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NSString (AdExtensions)
- (NSString *) md5;
+ (NSString *) URLEncodeString:(NSString*)string;
- (NSString *) URLEncodeString;
@end
@interface NSData (AdExtensions)
- (NSData*)dataByHmacSHA256EncryptingWithKey:(NSData*)key;
- (NSString*)stringWithHexBytes;
+ (NSData*)dataWithRandomBytes:(int)length;
@end
//from https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5
@interface UIDevice (AdExtensions)
/*
* @method uniqueDeviceIdentifier
* @description use this method when you need a unique identifier in one app.
* It generates a hash from the MAC-address in combination with the bundle identifier
* of your app.
*/
- (NSString *) uniqueDeviceIdentifier;
/*
* @method uniqueGlobalDeviceIdentifier
* @description use this method when you need a unique global identifier to track a device
* with multiple apps. as example a advertising network will use this method to track the device
* from different apps.
* It generates a hash from the MAC-address only.
*/
- (NSString *) uniqueGlobalDeviceIdentifier;
@end