commit | author | age
|
2e29a3
|
1 |
/* |
L |
2 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. |
|
7 |
*/ |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
NS_ASSUME_NONNULL_BEGIN |
|
12 |
|
|
13 |
NS_SWIFT_NAME(Base64) |
|
14 |
@interface FBSDKBase64 : NSObject |
|
15 |
|
|
16 |
/** |
|
17 |
Decodes a base-64 encoded string. |
|
18 |
@param string The base-64 encoded string. |
|
19 |
@return NSData containing the decoded bytes. |
|
20 |
*/ |
|
21 |
+ (nullable NSData *)decodeAsData:(nullable NSString *)string; |
|
22 |
|
|
23 |
/** |
|
24 |
Decodes a base-64 encoded string into a string. |
|
25 |
@param string The base-64 encoded string. |
|
26 |
@return NSString with the decoded UTF-8 value. |
|
27 |
*/ |
|
28 |
+ (nullable NSString *)decodeAsString:(nullable NSString *)string; |
|
29 |
|
|
30 |
/** |
|
31 |
Encodes data into a string. |
|
32 |
@param data The data to be encoded. |
|
33 |
@return The base-64 encoded string. |
|
34 |
*/ |
|
35 |
+ (nullable NSString *)encodeData:(nullable NSData *)data; |
|
36 |
|
|
37 |
/** |
|
38 |
Encodes string into a base-64 representation. |
|
39 |
@param string The string to be encoded. |
|
40 |
@return The base-64 encoded string. |
|
41 |
*/ |
|
42 |
+ (nullable NSString *)encodeString:(nullable NSString *)string; |
|
43 |
|
|
44 |
/** |
|
45 |
Encodes URL string into a base-64 representation. |
|
46 |
@param base64Url The URL string to be encoded. |
|
47 |
@return The base-64 encoded string. |
|
48 |
*/ |
|
49 |
+ (NSString *)base64FromBase64Url:(NSString *)base64Url; |
|
50 |
|
|
51 |
@end |
|
52 |
|
|
53 |
NS_ASSUME_NONNULL_END |