Skip to content

Commit ac4dfcc

Browse files
itingliufabianfett
andcommitted
rdar://159762558 ([SwiftFoundation Public PR swiftlang#1195] [Base64] Add new encoding options) (#3418)
Signed-off-by: Tina Liu <[email protected]> Co-authored-by: Fabian Fett <[email protected]>
1 parent 58ee897 commit ac4dfcc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/FoundationEssentials/Data/Data.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,6 +2918,15 @@ extension Data {
29182918
}
29192919
#endif //!FOUNDATION_FRAMEWORK
29202920

2921+
extension Data.Base64EncodingOptions {
2922+
/// Use the base64url alphabet to encode the data
2923+
@available(FoundationPreview 6.3, *)
2924+
public static let base64URLAlphabet = Self(rawValue: 1 << 6)
2925+
2926+
/// Omit the `=` padding characters in the end of the base64 encoded result
2927+
@available(FoundationPreview 6.3, *)
2928+
public static let omitPaddingCharacter = Self(rawValue: 1 << 7)
2929+
}
29212930

29222931
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
29232932
extension Data : CustomStringConvertible, CustomDebugStringConvertible, CustomReflectable {

0 commit comments

Comments
 (0)