commit | author | age
|
e0ec42
|
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 string into a base-64 representation. |
|
32 |
@param string The string to be encoded. |
|
33 |
@return The base-64 encoded string. |
|
34 |
*/ |
|
35 |
+ (nullable NSString *)encodeString:(nullable NSString *)string; |
|
36 |
|
|
37 |
/** |
|
38 |
Encodes URL string into a base-64 representation. |
|
39 |
@param base64Url The URL string to be encoded. |
|
40 |
@return The base-64 encoded string. |
|
41 |
*/ |
|
42 |
+ (NSString *)base64FromBase64Url:(NSString *)base64Url; |
|
43 |
|
|
44 |
@end |
|
45 |
|
|
46 |
NS_ASSUME_NONNULL_END |