HHuckebein / HHBase64

Swift 3 based Base64 encoding/decoding, add the under iOS missing .urlSafe encoding/decoding.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HHBase64

Swift Carthage Compatible codecov

Base64 encoding/decoding. Provides .urlSafe/.standard (iOS compatible) encoding of type Data and decoding of type String. You can, when encoding, ask for padding. When decoding padding is ignored if you choose .urlSafe decoding.

How to use HHBase64

Encoding

Base64.encode(data, coding: .urlSafe)
Base64.encode(data, coding: .urlSafe, padding: .off)

Base64.encode(data) // .standard is default as is .on for padding

Decoding

Base64.decode(data, coding: .urlSafe)
Base64.decode(data) // .standard is default

Installation

Installation with Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Base64 into your Xcode project using Carthage, specify it in your Cartfile:

github "HHuckebein/HHBase64"

Run carthage to build the framework and drag the built HHBase64.framework into your Xcode project.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, add HHBase64 as a dependency by adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/HHuckebein/HHBase64", .upToNextMajor(from: "1.0.0"))
]

Author

RABE_IT Services, development@berndrabe.de

License

Base64 is available under the MIT license. See the LICENSE file for more info.

About

Swift 3 based Base64 encoding/decoding, add the under iOS missing .urlSafe encoding/decoding.

License:MIT License


Languages

Language:Swift 98.3%Language:Objective-C 1.7%