Skip to content

SwiftHelpers v0.0.17

Compare
Choose a tag to compare
@leoho0722 leoho0722 released this 09 Feb 07:44
· 2 commits to main since this release

Rewrite Base64 with protocols, and update coding style

This major update

  • Rewrite Base64 with protocols and deprecated some functions

Base64Encodable

public protocol Base64Encodable {

    static func base64EncodedString(from original: String) -> String
    
    static func base64URLEncodedString(from original: String) -> String

    static func base64RawEncodedString(from original: String) -> String

    static func base64URLRawEncodedString(from original: String) -> String
}

Base64Decodable

public protocol Base64Decodable {

    static func base64DecodedString(from encodedString: String) throws -> String

    static func base64URLDecodedString(from encodedString: String) throws -> String
    
    static func base64RawDecodedString(from encodedString: String) throws -> String

    static func base64URLRawDecodedString(from encodedString: String) throws -> String
}

Base64Convertable

public protocol Base64Convertable {

    static func convert(with str: String, from old: Base64.Encoding, to new: Base64.Encoding) -> String
}

This major deprecated

Base64

static func base64EncodedString(from str: String, operation: Base64.Encoding) -> String
static func base64DecodedString(from str: String, operation: Base64.Encoding) throws -> String

This major unavailable

```swift
static func base64DecodedData(from str: String, operation: Base64.Encoding) throws -> Data