Skip to content

[Base64] Add new encoding options #1195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fabianfett
Copy link
Contributor

Implementation for pitch

@itingliu
Copy link
Contributor

Proposal: #1156

@@ -1804,17 +1804,65 @@ extension DataTests {
XCTAssertEqual(Data().base64EncodedData(), Data())
}

func test_base64Encode_allBytesSequentially() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you probably have noticed we've switched to swift-testing for all of our tests. Can you update this test to use swift-testing?

@@ -2766,6 +2766,14 @@ extension Data {
public static let endLineWithCarriageReturn = Base64EncodingOptions(rawValue: 1 << 4)
/// When a maximum line length is set, specify that the line ending to insert should include a line feed.
public static let endLineWithLineFeed = Base64EncodingOptions(rawValue: 1 << 5)

/// Use the base64url alphabet to encode the data
@available(FoundationPreview 6.2, *)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to update this to 6.3 since we've passed 6.2. Just so we don't forget we'll want to update the proposal too

@itingliu itingliu added the API Change Any changes to Foundation's public API surface label Aug 20, 2025
@fabianfett fabianfett force-pushed the ff-add-new-encoding-options branch from 31a85fa to 671392f Compare August 21, 2025 17:17
@fabianfett fabianfett marked this pull request as ready for review August 21, 2025 17:22
@itingliu
Copy link
Contributor

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Change Any changes to Foundation's public API surface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants