Skip to content

carabina/base64url-swift

 
 

Repository files navigation

Base64 URL for Swift

Supports conversion to and from the base64 URL format. This format differs from normal base64 in that it only includes characters that can be used safely in a URL.

Installation

You can add this framework to your Xcode project using CocoaPods. Add the following to your Podfile:

pod 'base64url', '~> 1.0'

Usage

Convert a Data struct into a base64url string:

Data(bytes: [255, 1, 2]).base64urlEncodedString() // equals "_wEC"

Convert base64url string into a Data struct:

Data(base64urlEncoded: "AAECAw") // equals Data(bytes: [0, 1, 2, 3])

About

Base64URL encoding and decoding in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 67.7%
  • Ruby 20.1%
  • Objective-C 12.2%